{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b310eb50-ef38-453f-932a-b146c70b0d3e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "data_analysis.py\n",
      "extracted_features.csv\n",
      "extracted_features_stats.txt\n",
      "feature_extraction.py\n",
      "Q1_1 源域数据整合  - 共享版本.ipynb\n",
      "Q1_2 目标域数据整理 - 共享版本.ipynb\n",
      "requirements.txt\n",
      "task1.py\n",
      "test.py\n",
      "任务1_数据分析与特征提取报告.md\n",
      "基于连续小波变换和LSTM-CNN-ATTENTION的高铁轴承故障智能分析.pptx\n",
      "高速列车轴承智能故障诊断问题.docx\n",
      ".git\\AUTO_MERGE\n",
      ".git\\COMMIT_EDITMSG\n",
      ".git\\config\n",
      ".git\\description\n",
      ".git\\FETCH_HEAD\n",
      ".git\\HEAD\n",
      ".git\\index\n",
      ".git\\MERGE_HEAD\n",
      ".git\\MERGE_MODE\n",
      ".git\\MERGE_MSG\n",
      ".git\\ORIG_HEAD\n",
      ".git\\packed-refs\n",
      ".git\\hooks\\applypatch-msg.sample\n",
      ".git\\hooks\\commit-msg.sample\n",
      ".git\\hooks\\fsmonitor-watchman.sample\n",
      ".git\\hooks\\post-update.sample\n",
      ".git\\hooks\\pre-applypatch.sample\n",
      ".git\\hooks\\pre-commit.sample\n",
      ".git\\hooks\\pre-merge-commit.sample\n",
      ".git\\hooks\\pre-push.sample\n",
      ".git\\hooks\\pre-rebase.sample\n",
      ".git\\hooks\\pre-receive.sample\n",
      ".git\\hooks\\prepare-commit-msg.sample\n",
      ".git\\hooks\\push-to-checkout.sample\n",
      ".git\\hooks\\sendemail-validate.sample\n",
      ".git\\hooks\\update.sample\n",
      ".git\\info\\exclude\n",
      ".git\\logs\\HEAD\n",
      ".git\\logs\\refs\\heads\\li_code\n",
      ".git\\logs\\refs\\heads\\main\n",
      ".git\\logs\\refs\\remotes\\origin\\HEAD\n",
      ".git\\logs\\refs\\remotes\\origin\\main\n",
      ".git\\objects\\01\\a0cfcd7f003da51900d6dbbb436180de7b6432\n",
      ".git\\objects\\10\\5ce2da2d6447d11dfe32bfb846c3d5b199fc99\n",
      ".git\\objects\\10\\e932d6fb03384dca7f6ffe5d59e81da04a4015\n",
      ".git\\objects\\13\\566b81b018ad684f3a35fee301741b2734c8f4\n",
      ".git\\objects\\13\\9a4c32869a31708f7e497fa9110192c79a3409\n",
      ".git\\objects\\18\\9a71d8abf1ebcbb5dd8b11ba784d4fe3c55037\n",
      ".git\\objects\\1e\\c712e86222943f4cc5ad4e1554e9f7489e78f7\n",
      ".git\\objects\\28\\222b45d2f8548484cb54ca700f56a967b83275\n",
      ".git\\objects\\28\\62f0118266c6925dbdea3c94f762adf788bce8\n",
      ".git\\objects\\28\\c11959a69706d782114d93d9eac617023e9b4c\n",
      ".git\\objects\\2c\\ef058115d15d11064bb367bf64ced7acc511b7\n",
      ".git\\objects\\3c\\0772be224225dd92bb8caa1712f73a7ba65c62\n",
      ".git\\objects\\3c\\868b68b1c989a52a25b7bafd699a9a70f6c07a\n",
      ".git\\objects\\4f\\adf3209c7ca7bfebac5909cea03f4d5861aefd\n",
      ".git\\objects\\52\\9129477bcfdc42c7d03c63eac6d27a0a97e8d1\n",
      ".git\\objects\\6a\\47b1ecec89126ef541199123dbb94f5bb7b2e4\n",
      ".git\\objects\\6f\\47d5000f6b29a4eccbcb7ad6d16631f8d8b01c\n",
      ".git\\objects\\73\\a27f2c0c1fb82967e4fede9275633c1aee948b\n",
      ".git\\objects\\7a\\1dd1824c0f8a87e9865ae3e966e19d4434f036\n",
      ".git\\objects\\7d\\5014aa300bb4ea7092f65b3c7ca9364dff74bf\n",
      ".git\\objects\\7f\\93e3f98ee86c46574b66baf07b37fb11c86fc2\n",
      ".git\\objects\\81\\13bd70d866064dbbe87717d46c8d214b59aa1d\n",
      ".git\\objects\\86\\c3e9c3735f42ba2711cb8ed1b34c81bcf6a403\n",
      ".git\\objects\\87\\2d9883d9e98bbcae85230520d167023515a98f\n",
      ".git\\objects\\8f\\15200ab1c09bcca655a7203c12d2d986a398d5\n",
      ".git\\objects\\90\\b87fb5e35a569af2a9e59a7b3ad24fb7762f55\n",
      ".git\\objects\\94\\a25f7f4cb416c083d265558da75d457237d671\n",
      ".git\\objects\\96\\cae225ac1abbe6176c68e424d1f3b66c09af68\n",
      ".git\\objects\\9c\\3b3d0c8b5b8a949ca5f85e2838c5211685e355\n",
      ".git\\objects\\a8\\9fe91c08199590c83033b3f24f839289c49939\n",
      ".git\\objects\\a9\\d69362419f69e82492a050cef29d092a514038\n",
      ".git\\objects\\ad\\05c2686a6d19f47fa9e511d2ba2391e5bd57ab\n",
      ".git\\objects\\ad\\714feaf871431219a1cd0b9e60bd4e7cacb098\n",
      ".git\\objects\\b1\\e4a63bc9c5e1b7dd3f7bfdd253ceae53aa258c\n",
      ".git\\objects\\b4\\722af94e4c65f47cea6bc3034220f8ffdc04ba\n",
      ".git\\objects\\bf\\74509c02964ebfaad33ff5fb327aeb070db4be\n",
      ".git\\objects\\c6\\c6238ddce0b8416583835642f3e966d6499e59\n",
      ".git\\objects\\c8\\ea98c8cbddb07ae05821f5f3fc323c81f99d7c\n",
      ".git\\objects\\d0\\876a78d06ac03b5d78c8dcdb95570281c6f1d6\n",
      ".git\\objects\\d0\\8a43bc3825d2a2b7cde2a5bb7f4806646b0ca3\n",
      ".git\\objects\\d0\\ce86abf7d955eab8435d60e9d8640b5900408d\n",
      ".git\\objects\\da\\027ac821ad112de81c8d77b3c9b77c50cc7872\n",
      ".git\\objects\\dd\\0b6c21c0231c70b31fbb7dd8a404f78c65fc22\n",
      ".git\\objects\\df\\7d70ba14fbaa6991a9af7015b751efa214bd6a\n",
      ".git\\objects\\e0\\369f70fef50b78c9a6658e4f3c67ade92aa8e4\n",
      ".git\\objects\\e6\\9de29bb2d1d6434b8b29ae775ad8c2e48c5391\n",
      ".git\\objects\\e9\\04651a49b6c03200fdf9bf4f4a789cf9008462\n",
      ".git\\objects\\e9\\cfb85687c717e2b14753aceba9da4e2884667e\n",
      ".git\\objects\\ec\\b45300613c3621d65e0fbe1cce840826e442e6\n",
      ".git\\objects\\ee\\7ec5c598ffbfc8198f79d60f637fdea157d38d\n",
      ".git\\objects\\ef\\0f58f464b5dd44900357b7aa05ebc67fef9987\n",
      ".git\\objects\\ef\\a052e5b2610f300ecc2ca25357e9d54e970637\n",
      ".git\\objects\\f0\\a1ec1780d4d62fae1a151f7dcd98f5fe6391c1\n",
      ".git\\objects\\f1\\69d50f7cbe8a4e707719ca2faf5b01ac2af212\n",
      ".git\\objects\\f7\\f1903598fb10cb3962da327a36ae9ae6b3a413\n",
      ".git\\objects\\f8\\26518948d8b7ec8bf5e8dba6650ea11c7f8683\n",
      ".git\\objects\\pack\\pack-1664cbc226d0f378c8022be98d6c502eafa605c9.idx\n",
      ".git\\objects\\pack\\pack-1664cbc226d0f378c8022be98d6c502eafa605c9.pack\n",
      ".git\\objects\\pack\\pack-1664cbc226d0f378c8022be98d6c502eafa605c9.rev\n",
      ".git\\objects\\pack\\pack-fba59c0bddfd6f04780ad2587fb4690c0521051b.idx\n",
      ".git\\objects\\pack\\pack-fba59c0bddfd6f04780ad2587fb4690c0521051b.pack\n",
      ".git\\objects\\pack\\pack-fba59c0bddfd6f04780ad2587fb4690c0521051b.rev\n",
      ".git\\refs\\heads\\li_code\n",
      ".git\\refs\\heads\\main\n",
      ".git\\refs\\remotes\\origin\\HEAD\n",
      ".git\\refs\\remotes\\origin\\main\n",
      ".idea\\deployment.xml\n",
      ".idea\\misc.xml\n",
      ".idea\\model.iml\n",
      ".idea\\modules.xml\n",
      ".idea\\vcs.xml\n",
      ".idea\\workspace.xml\n",
      ".idea\\inspectionProfiles\\profiles_settings.xml\n",
      ".idea\\inspectionProfiles\\Project_Default.xml\n",
      "feature_analysis\\dimensionality_reduction.png\n",
      "feature_analysis\\feature_correlation.png\n",
      "feature_analysis\\feature_distribution.png\n",
      "result1\\features_file_level_summary.csv\n",
      "result1\\features_window_level.csv\n",
      "result1\\trajectory_R_BSF_B_asym.png\n",
      "result1\\wave_overview.png\n",
      "result1\\win01_wave_env.png\n",
      "result1\\win01_wave_spectrum.png\n",
      "result1\\win02_wave_env.png\n",
      "result1\\win02_wave_spectrum.png\n",
      "result1\\win03_wave_env.png\n",
      "result1\\win03_wave_spectrum.png\n",
      "result1\\win04_wave_env.png\n",
      "result1\\win04_wave_spectrum.png\n",
      "源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0007\\B007_2.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0007\\B007_3.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0014\\B014_0.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0014\\B014_1.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0014\\B014_2.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0014\\B014_3.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0021\\B021_0.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0021\\B021_1.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0021\\B021_2.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0021\\B021_3.mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0028\\B028_0_(1797rpm).mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0028\\B028_1_(1772rpm).mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0028\\B028_2_(1750rpm).mat\n",
      "源域数据集\\12kHz_DE_data\\B\\0028\\B028_3_(1730rpm).mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0007\\IR007_0.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0007\\IR007_1.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0007\\IR007_2.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0007\\IR007_3.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0014\\IR014_0.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0014\\IR014_1.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0014\\IR014_2.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0014\\IR014_3.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0021\\IR021_0.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0021\\IR021_1.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0021\\IR021_2.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0021\\IR021_3.mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0028\\IR028_0_(1797rpm).mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0028\\IR028_1_(1772rpm).mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0028\\IR028_2_(1750rpm).mat\n",
      "源域数据集\\12kHz_DE_data\\IR\\0028\\IR028_3_(1730rpm).mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0007\\OR007@6_0.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0007\\OR007@6_1.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0007\\OR007@6_2.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0007\\OR007@6_3.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0014\\OR014@6_0.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0014\\OR014@6_1.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0014\\OR014@6_2.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0014\\OR014@6_3.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0021\\OR021@6_0.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0021\\OR021@6_1.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0021\\OR021@6_2.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Centered\\0021\\OR021@6_3.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_0.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_1.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_2.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_3.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_0.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_1.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_2.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_3.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_0.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_1.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_2.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_3.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_0.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_1.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_2.mat\n",
      "源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_3.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0007\\B007_0.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0007\\B007_1.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0007\\B007_2.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0007\\B007_3.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0014\\B014_0.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0014\\B014_1.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0014\\B014_2.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0014\\B014_3.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0021\\B021_0.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0021\\B021_1.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0021\\B021_2.mat\n",
      "源域数据集\\12kHz_FE_data\\B\\0021\\B021_3.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0007\\IR007_0.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0007\\IR007_1.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0007\\IR007_2.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0007\\IR007_3.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0014\\IR014_0.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0014\\IR014_1.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0014\\IR014_2.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0014\\IR014_3.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0021\\IR021_0.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0021\\IR021_1.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0021\\IR021_2.mat\n",
      "源域数据集\\12kHz_FE_data\\IR\\0021\\IR021_3.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Centered\\0007\\OR007@6_0.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Centered\\0007\\OR007@6_1.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Centered\\0007\\OR007@6_2.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Centered\\0007\\OR007@6_3.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Centered\\0014\\OR014@6_0.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Centered\\0021\\OR021@6_0.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Opposite\\0007\\OR007@12_0.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Opposite\\0007\\OR007@12_1.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Opposite\\0007\\OR007@12_2.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Opposite\\0007\\OR007@12_3.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0007\\OR007@3_0.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0007\\OR007@3_1.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0007\\OR007@3_2.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0007\\OR007@3_3.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0014\\OR014@3_0.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0014\\OR014@3_1.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0014\\OR014@3_2.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0014\\OR014@3_3.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0021\\OR021@3_1.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0021\\OR021@3_2.mat\n",
      "源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0021\\OR021@3_3.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0007\\B007_0.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0007\\B007_1.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0007\\B007_2.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0007\\B007_3.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0014\\B014_0.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0014\\B014_1.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0014\\B014_2.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0014\\B014_3.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0021\\B021_0.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0021\\B021_1.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0021\\B021_2.mat\n",
      "源域数据集\\48kHz_DE_data\\B\\0021\\B021_3.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0007\\IR007_0.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0007\\IR007_1.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0007\\IR007_2.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0007\\IR007_3.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0014\\IR014_0.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0014\\IR014_1.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0014\\IR014_2.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0014\\IR014_3.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0021\\IR021_0.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0021\\IR021_1.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0021\\IR021_2.mat\n",
      "源域数据集\\48kHz_DE_data\\IR\\0021\\IR021_3.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0007\\OR007@6_0.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0007\\OR007@6_1.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0007\\OR007@6_2.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0007\\OR007@6_3.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0014\\OR014@6_0.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0014\\OR014@6_1.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0014\\OR014@6_2.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0014\\OR014@6_3.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0021\\OR021@6_0.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0021\\OR021@6_1.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0021\\OR021@6_2.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Centered\\0021\\OR021@6_3.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_0.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_1.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_2.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_3.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_0.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_1.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_2.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_3.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_0.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_1.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_2.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_3.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_0.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_1.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_2.mat\n",
      "源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_3.mat\n",
      "源域数据集\\48kHz_Normal_data\\N_0.mat\n",
      "源域数据集\\48kHz_Normal_data\\N_1_(1772rpm).mat\n",
      "源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat\n",
      "源域数据集\\48kHz_Normal_data\\N_3.mat\n",
      "目标域数据集\\A.mat\n",
      "目标域数据集\\B.mat\n",
      "目标域数据集\\C.mat\n",
      "目标域数据集\\D.mat\n",
      "目标域数据集\\E.mat\n",
      "目标域数据集\\F.mat\n",
      "目标域数据集\\G.mat\n",
      "目标域数据集\\H.mat\n",
      "目标域数据集\\I.mat\n",
      "目标域数据集\\J.mat\n",
      "目标域数据集\\K.mat\n",
      "目标域数据集\\L.mat\n",
      "目标域数据集\\M.mat\n",
      "目标域数据集\\N.mat\n",
      "目标域数据集\\O.mat\n",
      "目标域数据集\\P.mat\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "\n",
    "current_dir = os.getcwd()\n",
    "\n",
    "for root, dirs, files in os.walk(current_dir):\n",
    "    for file in files:\n",
    "        # 获取相对路径\n",
    "        rel_path = os.path.relpath(os.path.join(root, file), current_dir)\n",
    "        print(rel_path)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0b07647a-8bf2-458e-8a35-53c75d6d536a",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat\n",
      "  变量: X118_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X118_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X118_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X118RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat\n",
      "  变量: X119_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X119_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X119_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X119RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0007\\B007_2.mat\n",
      "  变量: X120_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X120_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X120_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X120RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0007\\B007_3.mat\n",
      "  变量: X121_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X121_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X121_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X121RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0014\\B014_0.mat\n",
      "  变量: X185_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X185_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X185_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X185RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0014\\B014_1.mat\n",
      "  变量: X186_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X186_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X186_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X186RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0014\\B014_2.mat\n",
      "  变量: X187_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X187_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X187_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X187RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0014\\B014_3.mat\n",
      "  变量: X188_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X188_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X188_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X188RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0021\\B021_0.mat\n",
      "  变量: X222_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X222_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X222_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X222RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0021\\B021_1.mat\n",
      "  变量: X223_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X223_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X223_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X223RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0021\\B021_2.mat\n",
      "  变量: X224_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X224_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X224_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X224RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0021\\B021_3.mat\n",
      "  变量: X225_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X225_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X225_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X225RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0028\\B028_0_(1797rpm).mat\n",
      "  变量: X048_DE_time, 样本数: 96000, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0028\\B028_1_(1772rpm).mat\n",
      "  变量: X049_DE_time, 样本数: 96000, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0028\\B028_2_(1750rpm).mat\n",
      "  变量: X050_DE_time, 样本数: 96000, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\B\\0028\\B028_3_(1730rpm).mat\n",
      "  变量: X051_DE_time, 样本数: 96000, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0007\\IR007_0.mat\n",
      "  变量: X105_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X105_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X105_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X105RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0007\\IR007_1.mat\n",
      "  变量: X106_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X106_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X106_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X106RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0007\\IR007_2.mat\n",
      "  变量: X107_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X107_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X107_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X107RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0007\\IR007_3.mat\n",
      "  变量: X108_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X108_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X108_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X108RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0014\\IR014_0.mat\n",
      "  变量: X169_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X169_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X169_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X169RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0014\\IR014_1.mat\n",
      "  变量: X170_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X170_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X170_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X170RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0014\\IR014_2.mat\n",
      "  变量: X171_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X171_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X171_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X171RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0014\\IR014_3.mat\n",
      "  变量: X172_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X172_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X172_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X172RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0021\\IR021_0.mat\n",
      "  变量: X209_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X209_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X209_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X209RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0021\\IR021_1.mat\n",
      "  变量: X210_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X210_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X210_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X210RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0021\\IR021_2.mat\n",
      "  变量: X211_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X211_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X211_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X211RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0021\\IR021_3.mat\n",
      "  变量: X212_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X212_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X212_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X212RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0028\\IR028_0_(1797rpm).mat\n",
      "  变量: X056_DE_time, 样本数: 96000, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0028\\IR028_1_(1772rpm).mat\n",
      "  变量: X057_DE_time, 样本数: 96000, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0028\\IR028_2_(1750rpm).mat\n",
      "  变量: X058_DE_time, 样本数: 96000, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\IR\\0028\\IR028_3_(1730rpm).mat\n",
      "  变量: X059_DE_time, 样本数: 96000, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0007\\OR007@6_0.mat\n",
      "  变量: X130_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X130_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X130_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X130RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0007\\OR007@6_1.mat\n",
      "  变量: X131_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X131_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X131_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X131RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0007\\OR007@6_2.mat\n",
      "  变量: X132_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X132_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X132_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X132RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0007\\OR007@6_3.mat\n",
      "  变量: X133_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X133_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X133_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X133RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0014\\OR014@6_0.mat\n",
      "  变量: X197_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X197_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X197_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X197RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0014\\OR014@6_1.mat\n",
      "  变量: X198_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X198_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X198_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X198RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0014\\OR014@6_2.mat\n",
      "  变量: X199_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X199_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X199_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X199RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0014\\OR014@6_3.mat\n",
      "  变量: X200_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X200_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X200_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X200RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0021\\OR021@6_0.mat\n",
      "  变量: X234_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X234_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X234_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X234RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0021\\OR021@6_1.mat\n",
      "  变量: X235_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X235_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X235_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X235RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0021\\OR021@6_2.mat\n",
      "  变量: X236_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X236_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X236_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X236RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Centered\\0021\\OR021@6_3.mat\n",
      "  变量: X237_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X237_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X237_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X237RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_0.mat\n",
      "  变量: X156_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X156_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X156_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X156RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_1.mat\n",
      "  变量: X158_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X158_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X158_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X158RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_2.mat\n",
      "  变量: X159_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X159_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X159_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X159RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_3.mat\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  变量: X160_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X160_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X160_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X160RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_0.mat\n",
      "  变量: X258_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X258_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X258_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X258RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_1.mat\n",
      "  变量: X259_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X259_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X259_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X259RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_2.mat\n",
      "  变量: X260_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X260_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X260_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X260RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_3.mat\n",
      "  变量: X261_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X261_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X261_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X261RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_0.mat\n",
      "  变量: X144_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X144_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X144_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X144RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_1.mat\n",
      "  变量: X145_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X145_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X145_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X145RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_2.mat\n",
      "  变量: X146_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X146_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X146_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X146RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_3.mat\n",
      "  变量: X147_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X147_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X147_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X147RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_0.mat\n",
      "  变量: X246_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X246_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X246_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X246RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_1.mat\n",
      "  变量: X247_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X247_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X247_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X247RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_2.mat\n",
      "  变量: X248_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X248_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X248_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X248RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_3.mat\n",
      "  变量: X249_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X249_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X249_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X249RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0007\\B007_0.mat\n",
      "  变量: X282_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X282_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X282_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X282RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0007\\B007_1.mat\n",
      "  变量: X283_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X283_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X283_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X283RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0007\\B007_2.mat\n",
      "  变量: X284_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X284_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X284_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X284RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0007\\B007_3.mat\n",
      "  变量: X285_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X285_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X285_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X285RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0014\\B014_0.mat\n",
      "  变量: X286_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X286_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X286_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X286RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0014\\B014_1.mat\n",
      "  变量: X287_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X287_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X287_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X287RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0014\\B014_2.mat\n",
      "  变量: X288_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X288_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X288_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X288RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0014\\B014_3.mat\n",
      "  变量: X289_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X289_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X289_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X289RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0021\\B021_0.mat\n",
      "  变量: X290_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X290_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X290_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X290RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0021\\B021_1.mat\n",
      "  变量: X291_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X291_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X291_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X291RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0021\\B021_2.mat\n",
      "  变量: X292_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X292_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X292_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X292RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\B\\0021\\B021_3.mat\n",
      "  变量: X293_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X293_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X293_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X293RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0007\\IR007_0.mat\n",
      "  变量: X278_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X278_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X278_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X278RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0007\\IR007_1.mat\n",
      "  变量: X279_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X279_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X279_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X279RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0007\\IR007_2.mat\n",
      "  变量: X280_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X280_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X280_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X280RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0007\\IR007_3.mat\n",
      "  变量: X281_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X281_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X281_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X281RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0014\\IR014_0.mat\n",
      "  变量: X274_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X274_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X274_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X274RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0014\\IR014_1.mat\n",
      "  变量: X275_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X275_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X275_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X275RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0014\\IR014_2.mat\n",
      "  变量: X276_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X276_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X276_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X276RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0014\\IR014_3.mat\n",
      "  变量: X277_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X277_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X277_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X277RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0021\\IR021_0.mat\n",
      "  变量: X270_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X270_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X270_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X270RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0021\\IR021_1.mat\n",
      "  变量: X271_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X271_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X271_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X271RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0021\\IR021_2.mat\n",
      "  变量: X272_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X272_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X272_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X272RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\IR\\0021\\IR021_3.mat\n",
      "  变量: X273_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X273_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X273_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X273RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Centered\\0007\\OR007@6_0.mat\n",
      "  变量: X294_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X294_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X294_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X294RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Centered\\0007\\OR007@6_1.mat\n",
      "  变量: X295_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X295_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X295_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X295RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Centered\\0007\\OR007@6_2.mat\n",
      "  变量: X296_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X296_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X296_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X296RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Centered\\0007\\OR007@6_3.mat\n",
      "  变量: X297_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X297_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X297_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X297RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Centered\\0014\\OR014@6_0.mat\n",
      "  变量: X313_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X313_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X313_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X313RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Centered\\0021\\OR021@6_0.mat\n",
      "  变量: X315_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X315_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X315_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X315RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Opposite\\0007\\OR007@12_0.mat\n",
      "  变量: X302_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X302_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X302_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X302RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Opposite\\0007\\OR007@12_1.mat\n",
      "  变量: X305_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X305_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X305_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X305RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Opposite\\0007\\OR007@12_2.mat\n",
      "  变量: X306_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X306_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X306_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X306RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Opposite\\0007\\OR007@12_3.mat\n",
      "  变量: X307_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X307_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X307_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X307RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0007\\OR007@3_0.mat\n",
      "  变量: X298_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X298_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X298_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X298RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0007\\OR007@3_1.mat\n",
      "  变量: X299_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X299_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X299_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X299RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0007\\OR007@3_2.mat\n",
      "  变量: X300_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X300_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X300_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X300RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0007\\OR007@3_3.mat\n",
      "  变量: X301_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X301_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X301_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X301RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0014\\OR014@3_0.mat\n",
      "  变量: X310_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X310_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X310_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X310RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0014\\OR014@3_1.mat\n",
      "  变量: X309_DE_time, 样本数: 121168, 列数: 1\n",
      "  变量: X309_FE_time, 样本数: 121168, 列数: 1\n",
      "  变量: X309_BA_time, 样本数: 121168, 列数: 1\n",
      "  变量: X309RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0014\\OR014@3_2.mat\n",
      "  变量: X311_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X311_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X311_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X311RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0014\\OR014@3_3.mat\n",
      "  变量: X312_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X312_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X312_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X312RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0021\\OR021@3_1.mat\n",
      "  变量: X316_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X316_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X316_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X316RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0021\\OR021@3_2.mat\n",
      "  变量: X317_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X317_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X317_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X317RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\12kHz_FE_data\\OR\\Orthogonal\\0021\\OR021@3_3.mat\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  变量: X318_DE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X318_FE_time, 样本数: 96000, 列数: 1\n",
      "  变量: X318_BA_time, 样本数: 96000, 列数: 1\n",
      "  变量: X318RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0007\\B007_0.mat\n",
      "  变量: X122_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X122_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X122RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0007\\B007_1.mat\n",
      "  变量: X123_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X123_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X123RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0007\\B007_2.mat\n",
      "  变量: X124_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X124_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X124RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0007\\B007_3.mat\n",
      "  变量: X125_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X125_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X125RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0014\\B014_0.mat\n",
      "  变量: X189_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X189_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X189RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0014\\B014_1.mat\n",
      "  变量: X190_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X190_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X190RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0014\\B014_2.mat\n",
      "  变量: X191_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X191_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X191RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0014\\B014_3.mat\n",
      "  变量: X192_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X192_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X192RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0021\\B021_0.mat\n",
      "  变量: X226_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X226_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X226RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0021\\B021_1.mat\n",
      "  变量: X227_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X227_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X227RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0021\\B021_2.mat\n",
      "  变量: X228_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X228_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X228RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\B\\0021\\B021_3.mat\n",
      "  变量: X229_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X229_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X229RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0007\\IR007_0.mat\n",
      "  变量: X109_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X109_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X109RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0007\\IR007_1.mat\n",
      "  变量: X110_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X110_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X110RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0007\\IR007_2.mat\n",
      "  变量: X111_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X111_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X111RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0007\\IR007_3.mat\n",
      "  变量: X112_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X112_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X112RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0014\\IR014_0.mat\n",
      "  变量: X173_DE_time, 样本数: 63788, 列数: 1\n",
      "  变量: X173_FE_time, 样本数: 63788, 列数: 1\n",
      "  变量: X173RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0014\\IR014_1.mat\n",
      "  变量: X175_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X175_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X175RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0014\\IR014_2.mat\n",
      "  变量: X176_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X176_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X176RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0014\\IR014_3.mat\n",
      "  变量: X177_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X177_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X177RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0021\\IR021_0.mat\n",
      "  变量: X213_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X213_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X213RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0021\\IR021_1.mat\n",
      "  变量: X214_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X214_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X214RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0021\\IR021_2.mat\n",
      "  变量: X215_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X215_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X215RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\IR\\0021\\IR021_3.mat\n",
      "  变量: X217_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X217_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X217RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0007\\OR007@6_0.mat\n",
      "  变量: X135_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X135_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X135RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0007\\OR007@6_1.mat\n",
      "  变量: X136_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X136_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X136RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0007\\OR007@6_2.mat\n",
      "  变量: X137_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X137_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X137RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0007\\OR007@6_3.mat\n",
      "  变量: X138_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X138_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X138RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0014\\OR014@6_0.mat\n",
      "  变量: X201_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X201_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X201RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0014\\OR014@6_1.mat\n",
      "  变量: X202_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X202_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X202RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0014\\OR014@6_2.mat\n",
      "  变量: X203_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X203_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X203RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0014\\OR014@6_3.mat\n",
      "  变量: X204_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X204_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X204RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0021\\OR021@6_0.mat\n",
      "  变量: X238_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X238_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X238RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0021\\OR021@6_1.mat\n",
      "  变量: X239_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X239_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X239RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0021\\OR021@6_2.mat\n",
      "  变量: X240_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X240_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X240RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Centered\\0021\\OR021@6_3.mat\n",
      "  变量: X241_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X241_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X241RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_0.mat\n",
      "  变量: X161_DE_time, 样本数: 129969, 列数: 1\n",
      "  变量: X161_FE_time, 样本数: 129969, 列数: 1\n",
      "  变量: X161RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_1.mat\n",
      "  变量: X162_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X162_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X162RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_2.mat\n",
      "  变量: X163_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X163_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X163RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Opposite\\0007\\OR007@12_3.mat\n",
      "  变量: X164_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X164_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X164RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_0.mat\n",
      "  变量: X262_DE_time, 样本数: 130549, 列数: 1\n",
      "  变量: X262_FE_time, 样本数: 130549, 列数: 1\n",
      "  变量: X262RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_1.mat\n",
      "  变量: X263_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X263_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X263RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_2.mat\n",
      "  变量: X264_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X264_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X264RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Opposite\\0021\\OR021@12_3.mat\n",
      "  变量: X265_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X265_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X265RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_0.mat\n",
      "  变量: X148_DE_time, 样本数: 124602, 列数: 1\n",
      "  变量: X148_FE_time, 样本数: 124602, 列数: 1\n",
      "  变量: X148RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_1.mat\n",
      "  变量: X149_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X149_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X149RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_2.mat\n",
      "  变量: X150_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X150_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X150RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0007\\OR007@3_3.mat\n",
      "  变量: X151_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X151_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X151RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_0.mat\n",
      "  变量: X250_DE_time, 样本数: 128663, 列数: 1\n",
      "  变量: X250_FE_time, 样本数: 128663, 列数: 1\n",
      "  变量: X250RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_1.mat\n",
      "  变量: X251_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X251_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X251RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_2.mat\n",
      "  变量: X252_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X252_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X252RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_3.mat\n",
      "  变量: X253_DE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X253_FE_time, 样本数: 192000, 列数: 1\n",
      "  变量: X253RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_Normal_data\\N_0.mat\n",
      "  变量: X097_DE_time, 样本数: 243938, 列数: 1\n",
      "  变量: X097_FE_time, 样本数: 243938, 列数: 1\n",
      "  变量: X097RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_Normal_data\\N_1_(1772rpm).mat\n",
      "  变量: X098_DE_time, 样本数: 384000, 列数: 1\n",
      "  变量: X098_FE_time, 样本数: 384000, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat\n",
      "  变量: X099_DE_time, 样本数: 384000, 列数: 1\n",
      "  变量: X099_FE_time, 样本数: 384000, 列数: 1\n",
      "\n",
      " 文件: 源域数据集\\48kHz_Normal_data\\N_3.mat\n",
      "  变量: X100_DE_time, 样本数: 384000, 列数: 1\n",
      "  变量: X100_FE_time, 样本数: 384000, 列数: 1\n",
      "  变量: X100RPM, 样本数: 1, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\A.mat\n",
      "  变量: A, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\B.mat\n",
      "  变量: B, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\C.mat\n",
      "  变量: C, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\D.mat\n",
      "  变量: D, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\E.mat\n",
      "  变量: E, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\F.mat\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  变量: F, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\G.mat\n",
      "  变量: G, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\H.mat\n",
      "  变量: H, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\I.mat\n",
      "  变量: I, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\J.mat\n",
      "  变量: J, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\K.mat\n",
      "  变量: K, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\L.mat\n",
      "  变量: L, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\M.mat\n",
      "  变量: M, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\N.mat\n",
      "  变量: N, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\O.mat\n",
      "  变量: O, 样本数: 256000, 列数: 1\n",
      "\n",
      " 文件: 目标域数据集\\P.mat\n",
      "  变量: P, 样本数: 256000, 列数: 1\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "from pathlib import Path\n",
    "import scipy.io as sio\n",
    "import numpy as np\n",
    "\n",
    "# 当前目录\n",
    "current_dir = Path.cwd()\n",
    "\n",
    "# 遍历所有 .mat 文件\n",
    "for file in current_dir.rglob(\"*.mat\"):\n",
    "    rel_path = file.relative_to(current_dir)  # 相对路径\n",
    "    print(f\"\\n 文件: {rel_path}\")\n",
    "\n",
    "    try:\n",
    "        mat_data = sio.loadmat(file)\n",
    "        # 筛掉 Matlab 内置的 __ 开头变量\n",
    "        variables = [k for k in mat_data.keys() if not k.startswith(\"__\")]\n",
    "\n",
    "        for var in variables:\n",
    "            data = mat_data[var]\n",
    "\n",
    "            if isinstance(data, np.ndarray):\n",
    "                rows, cols = data.shape[0], data.shape[1] if data.ndim > 1 else 1\n",
    "                print(f\"  变量: {var}, 样本数: {rows}, 列数: {cols}\")\n",
    "            else:\n",
    "                print(f\"  变量: {var}, 类型: {type(data)} (非 ndarray)\")\n",
    "    except Exception as e:\n",
    "        print(f\"   读取失败: {e}\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "fa215c6d-588b-4f7b-8648-bc035e5fa6b9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>file</th>\n",
       "      <th>variable</th>\n",
       "      <th>samples</th>\n",
       "      <th>columns</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>X118_DE_time</td>\n",
       "      <td>96000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>X118_FE_time</td>\n",
       "      <td>96000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>X118_BA_time</td>\n",
       "      <td>96000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>X118RPM</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat</td>\n",
       "      <td>X119_DE_time</td>\n",
       "      <td>96000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>557</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat</td>\n",
       "      <td>X099_DE_time</td>\n",
       "      <td>384000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>558</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat</td>\n",
       "      <td>X099_FE_time</td>\n",
       "      <td>384000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>559</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>X100_DE_time</td>\n",
       "      <td>384000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>560</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>X100_FE_time</td>\n",
       "      <td>384000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>561</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>X100RPM</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>562 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                          file      variable  samples  columns\n",
       "0        源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat  X118_DE_time    96000        1\n",
       "1        源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat  X118_FE_time    96000        1\n",
       "2        源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat  X118_BA_time    96000        1\n",
       "3        源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat       X118RPM        1        1\n",
       "4        源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat  X119_DE_time    96000        1\n",
       "..                                         ...           ...      ...      ...\n",
       "557  源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat  X099_DE_time   384000        1\n",
       "558  源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat  X099_FE_time   384000        1\n",
       "559            源域数据集\\48kHz_Normal_data\\N_3.mat  X100_DE_time   384000        1\n",
       "560            源域数据集\\48kHz_Normal_data\\N_3.mat  X100_FE_time   384000        1\n",
       "561            源域数据集\\48kHz_Normal_data\\N_3.mat       X100RPM        1        1\n",
       "\n",
       "[562 rows x 4 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pathlib import Path\n",
    "import scipy.io as sio\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "# 当前目录\n",
    "current_dir = Path.cwd()\n",
    "\n",
    "records = []\n",
    "\n",
    "for file in current_dir.rglob(\"*.mat\"):\n",
    "    rel_path = file.relative_to(current_dir)\n",
    "\n",
    "    # 跳过“目标域数据集”目录下的文件\n",
    "    if \"目标域数据集\" in str(rel_path):\n",
    "        continue\n",
    "\n",
    "    try:\n",
    "        mat_data = sio.loadmat(file)\n",
    "        variables = [k for k in mat_data.keys() if not k.startswith(\"__\")]\n",
    "\n",
    "        for var in variables:\n",
    "            data = mat_data[var]\n",
    "            if isinstance(data, np.ndarray):\n",
    "                rows = data.shape[0]\n",
    "                cols = data.shape[1] if data.ndim > 1 else 1\n",
    "                records.append([str(rel_path), var, rows, cols])\n",
    "            else:\n",
    "                records.append([str(rel_path), var, None, None])\n",
    "    except Exception as e:\n",
    "        records.append([str(rel_path), \"读取失败\", None, None])\n",
    "\n",
    "# 转换为 DataFrame\n",
    "df = pd.DataFrame(records, columns=[\"file\", \"variable\", \"samples\", \"columns\"])\n",
    "\n",
    "df\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e5f08183-255b-462f-81ba-d826d58dbe79",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1], dtype=int64)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['columns'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "f3c673c1-3cb3-40de-8197-70d668e8089f",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.to_csv('df.csv',index=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "517c175c-3602-424b-ab83-edebd797e6c4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['X118_DE_time', 'X118_FE_time', 'X118_BA_time', 'X118RPM',\n",
       "       'X119_DE_time', 'X119_FE_time', 'X119_BA_time', 'X119RPM',\n",
       "       'X120_DE_time', 'X120_FE_time', 'X120_BA_time', 'X120RPM',\n",
       "       'X121_DE_time', 'X121_FE_time', 'X121_BA_time', 'X121RPM',\n",
       "       'X185_DE_time', 'X185_FE_time', 'X185_BA_time', 'X185RPM',\n",
       "       'X186_DE_time', 'X186_FE_time', 'X186_BA_time', 'X186RPM',\n",
       "       'X187_DE_time', 'X187_FE_time', 'X187_BA_time', 'X187RPM',\n",
       "       'X188_DE_time', 'X188_FE_time', 'X188_BA_time', 'X188RPM',\n",
       "       'X222_DE_time', 'X222_FE_time', 'X222_BA_time', 'X222RPM',\n",
       "       'X223_DE_time', 'X223_FE_time', 'X223_BA_time', 'X223RPM',\n",
       "       'X224_DE_time', 'X224_FE_time', 'X224_BA_time', 'X224RPM',\n",
       "       'X225_DE_time', 'X225_FE_time', 'X225_BA_time', 'X225RPM',\n",
       "       'X048_DE_time', 'X049_DE_time', 'X050_DE_time', 'X051_DE_time',\n",
       "       'X105_DE_time', 'X105_FE_time', 'X105_BA_time', 'X105RPM',\n",
       "       'X106_DE_time', 'X106_FE_time', 'X106_BA_time', 'X106RPM',\n",
       "       'X107_DE_time', 'X107_FE_time', 'X107_BA_time', 'X107RPM',\n",
       "       'X108_DE_time', 'X108_FE_time', 'X108_BA_time', 'X108RPM',\n",
       "       'X169_DE_time', 'X169_FE_time', 'X169_BA_time', 'X169RPM',\n",
       "       'X170_DE_time', 'X170_FE_time', 'X170_BA_time', 'X170RPM',\n",
       "       'X171_DE_time', 'X171_FE_time', 'X171_BA_time', 'X171RPM',\n",
       "       'X172_DE_time', 'X172_FE_time', 'X172_BA_time', 'X172RPM',\n",
       "       'X209_DE_time', 'X209_FE_time', 'X209_BA_time', 'X209RPM',\n",
       "       'X210_DE_time', 'X210_FE_time', 'X210_BA_time', 'X210RPM',\n",
       "       'X211_DE_time', 'X211_FE_time', 'X211_BA_time', 'X211RPM',\n",
       "       'X212_DE_time', 'X212_FE_time', 'X212_BA_time', 'X212RPM',\n",
       "       'X056_DE_time', 'X057_DE_time', 'X058_DE_time', 'X059_DE_time',\n",
       "       'X130_DE_time', 'X130_FE_time', 'X130_BA_time', 'X130RPM',\n",
       "       'X131_DE_time', 'X131_FE_time', 'X131_BA_time', 'X131RPM',\n",
       "       'X132_DE_time', 'X132_FE_time', 'X132_BA_time', 'X132RPM',\n",
       "       'X133_DE_time', 'X133_FE_time', 'X133_BA_time', 'X133RPM',\n",
       "       'X197_DE_time', 'X197_FE_time', 'X197_BA_time', 'X197RPM',\n",
       "       'X198_DE_time', 'X198_FE_time', 'X198_BA_time', 'X198RPM',\n",
       "       'X199_DE_time', 'X199_FE_time', 'X199_BA_time', 'X199RPM',\n",
       "       'X200_DE_time', 'X200_FE_time', 'X200_BA_time', 'X200RPM',\n",
       "       'X234_DE_time', 'X234_FE_time', 'X234_BA_time', 'X234RPM',\n",
       "       'X235_DE_time', 'X235_FE_time', 'X235_BA_time', 'X235RPM',\n",
       "       'X236_DE_time', 'X236_FE_time', 'X236_BA_time', 'X236RPM',\n",
       "       'X237_DE_time', 'X237_FE_time', 'X237_BA_time', 'X237RPM',\n",
       "       'X156_DE_time', 'X156_FE_time', 'X156_BA_time', 'X156RPM',\n",
       "       'X158_DE_time', 'X158_FE_time', 'X158_BA_time', 'X158RPM',\n",
       "       'X159_DE_time', 'X159_FE_time', 'X159_BA_time', 'X159RPM',\n",
       "       'X160_DE_time', 'X160_FE_time', 'X160_BA_time', 'X160RPM',\n",
       "       'X258_DE_time', 'X258_FE_time', 'X258_BA_time', 'X258RPM',\n",
       "       'X259_DE_time', 'X259_FE_time', 'X259_BA_time', 'X259RPM',\n",
       "       'X260_DE_time', 'X260_FE_time', 'X260_BA_time', 'X260RPM',\n",
       "       'X261_DE_time', 'X261_FE_time', 'X261_BA_time', 'X261RPM',\n",
       "       'X144_DE_time', 'X144_FE_time', 'X144_BA_time', 'X144RPM',\n",
       "       'X145_DE_time', 'X145_FE_time', 'X145_BA_time', 'X145RPM',\n",
       "       'X146_DE_time', 'X146_FE_time', 'X146_BA_time', 'X146RPM',\n",
       "       'X147_DE_time', 'X147_FE_time', 'X147_BA_time', 'X147RPM',\n",
       "       'X246_DE_time', 'X246_FE_time', 'X246_BA_time', 'X246RPM',\n",
       "       'X247_DE_time', 'X247_FE_time', 'X247_BA_time', 'X247RPM',\n",
       "       'X248_DE_time', 'X248_FE_time', 'X248_BA_time', 'X248RPM',\n",
       "       'X249_DE_time', 'X249_FE_time', 'X249_BA_time', 'X249RPM',\n",
       "       'X282_DE_time', 'X282_FE_time', 'X282_BA_time', 'X282RPM',\n",
       "       'X283_DE_time', 'X283_FE_time', 'X283_BA_time', 'X283RPM',\n",
       "       'X284_DE_time', 'X284_FE_time', 'X284_BA_time', 'X284RPM',\n",
       "       'X285_DE_time', 'X285_FE_time', 'X285_BA_time', 'X285RPM',\n",
       "       'X286_DE_time', 'X286_FE_time', 'X286_BA_time', 'X286RPM',\n",
       "       'X287_DE_time', 'X287_FE_time', 'X287_BA_time', 'X287RPM',\n",
       "       'X288_DE_time', 'X288_FE_time', 'X288_BA_time', 'X288RPM',\n",
       "       'X289_DE_time', 'X289_FE_time', 'X289_BA_time', 'X289RPM',\n",
       "       'X290_DE_time', 'X290_FE_time', 'X290_BA_time', 'X290RPM',\n",
       "       'X291_DE_time', 'X291_FE_time', 'X291_BA_time', 'X291RPM',\n",
       "       'X292_DE_time', 'X292_FE_time', 'X292_BA_time', 'X292RPM',\n",
       "       'X293_DE_time', 'X293_FE_time', 'X293_BA_time', 'X293RPM',\n",
       "       'X278_DE_time', 'X278_FE_time', 'X278_BA_time', 'X278RPM',\n",
       "       'X279_DE_time', 'X279_FE_time', 'X279_BA_time', 'X279RPM',\n",
       "       'X280_DE_time', 'X280_FE_time', 'X280_BA_time', 'X280RPM',\n",
       "       'X281_DE_time', 'X281_FE_time', 'X281_BA_time', 'X281RPM',\n",
       "       'X274_DE_time', 'X274_FE_time', 'X274_BA_time', 'X274RPM',\n",
       "       'X275_DE_time', 'X275_FE_time', 'X275_BA_time', 'X275RPM',\n",
       "       'X276_DE_time', 'X276_FE_time', 'X276_BA_time', 'X276RPM',\n",
       "       'X277_DE_time', 'X277_FE_time', 'X277_BA_time', 'X277RPM',\n",
       "       'X270_DE_time', 'X270_FE_time', 'X270_BA_time', 'X270RPM',\n",
       "       'X271_DE_time', 'X271_FE_time', 'X271_BA_time', 'X271RPM',\n",
       "       'X272_DE_time', 'X272_FE_time', 'X272_BA_time', 'X272RPM',\n",
       "       'X273_DE_time', 'X273_FE_time', 'X273_BA_time', 'X273RPM',\n",
       "       'X294_DE_time', 'X294_FE_time', 'X294_BA_time', 'X294RPM',\n",
       "       'X295_DE_time', 'X295_FE_time', 'X295_BA_time', 'X295RPM',\n",
       "       'X296_DE_time', 'X296_FE_time', 'X296_BA_time', 'X296RPM',\n",
       "       'X297_DE_time', 'X297_FE_time', 'X297_BA_time', 'X297RPM',\n",
       "       'X313_DE_time', 'X313_FE_time', 'X313_BA_time', 'X313RPM',\n",
       "       'X315_DE_time', 'X315_FE_time', 'X315_BA_time', 'X315RPM',\n",
       "       'X302_DE_time', 'X302_FE_time', 'X302_BA_time', 'X302RPM',\n",
       "       'X305_DE_time', 'X305_FE_time', 'X305_BA_time', 'X305RPM',\n",
       "       'X306_DE_time', 'X306_FE_time', 'X306_BA_time', 'X306RPM',\n",
       "       'X307_DE_time', 'X307_FE_time', 'X307_BA_time', 'X307RPM',\n",
       "       'X298_DE_time', 'X298_FE_time', 'X298_BA_time', 'X298RPM',\n",
       "       'X299_DE_time', 'X299_FE_time', 'X299_BA_time', 'X299RPM',\n",
       "       'X300_DE_time', 'X300_FE_time', 'X300_BA_time', 'X300RPM',\n",
       "       'X301_DE_time', 'X301_FE_time', 'X301_BA_time', 'X301RPM',\n",
       "       'X310_DE_time', 'X310_FE_time', 'X310_BA_time', 'X310RPM',\n",
       "       'X309_DE_time', 'X309_FE_time', 'X309_BA_time', 'X309RPM',\n",
       "       'X311_DE_time', 'X311_FE_time', 'X311_BA_time', 'X311RPM',\n",
       "       'X312_DE_time', 'X312_FE_time', 'X312_BA_time', 'X312RPM',\n",
       "       'X316_DE_time', 'X316_FE_time', 'X316_BA_time', 'X316RPM',\n",
       "       'X317_DE_time', 'X317_FE_time', 'X317_BA_time', 'X317RPM',\n",
       "       'X318_DE_time', 'X318_FE_time', 'X318_BA_time', 'X318RPM',\n",
       "       'X122_DE_time', 'X122_FE_time', 'X122RPM', 'X123_DE_time',\n",
       "       'X123_FE_time', 'X123RPM', 'X124_DE_time', 'X124_FE_time',\n",
       "       'X124RPM', 'X125_DE_time', 'X125_FE_time', 'X125RPM',\n",
       "       'X189_DE_time', 'X189_FE_time', 'X189RPM', 'X190_DE_time',\n",
       "       'X190_FE_time', 'X190RPM', 'X191_DE_time', 'X191_FE_time',\n",
       "       'X191RPM', 'X192_DE_time', 'X192_FE_time', 'X192RPM',\n",
       "       'X226_DE_time', 'X226_FE_time', 'X226RPM', 'X227_DE_time',\n",
       "       'X227_FE_time', 'X227RPM', 'X228_DE_time', 'X228_FE_time',\n",
       "       'X228RPM', 'X229_DE_time', 'X229_FE_time', 'X229RPM',\n",
       "       'X109_DE_time', 'X109_FE_time', 'X109RPM', 'X110_DE_time',\n",
       "       'X110_FE_time', 'X110RPM', 'X111_DE_time', 'X111_FE_time',\n",
       "       'X111RPM', 'X112_DE_time', 'X112_FE_time', 'X112RPM',\n",
       "       'X173_DE_time', 'X173_FE_time', 'X173RPM', 'X175_DE_time',\n",
       "       'X175_FE_time', 'X175RPM', 'X176_DE_time', 'X176_FE_time',\n",
       "       'X176RPM', 'X177_DE_time', 'X177_FE_time', 'X177RPM',\n",
       "       'X213_DE_time', 'X213_FE_time', 'X213RPM', 'X214_DE_time',\n",
       "       'X214_FE_time', 'X214RPM', 'X215_DE_time', 'X215_FE_time',\n",
       "       'X215RPM', 'X217_DE_time', 'X217_FE_time', 'X217RPM',\n",
       "       'X135_DE_time', 'X135_FE_time', 'X135RPM', 'X136_DE_time',\n",
       "       'X136_FE_time', 'X136RPM', 'X137_DE_time', 'X137_FE_time',\n",
       "       'X137RPM', 'X138_DE_time', 'X138_FE_time', 'X138RPM',\n",
       "       'X201_DE_time', 'X201_FE_time', 'X201RPM', 'X202_DE_time',\n",
       "       'X202_FE_time', 'X202RPM', 'X203_DE_time', 'X203_FE_time',\n",
       "       'X203RPM', 'X204_DE_time', 'X204_FE_time', 'X204RPM',\n",
       "       'X238_DE_time', 'X238_FE_time', 'X238RPM', 'X239_DE_time',\n",
       "       'X239_FE_time', 'X239RPM', 'X240_DE_time', 'X240_FE_time',\n",
       "       'X240RPM', 'X241_DE_time', 'X241_FE_time', 'X241RPM',\n",
       "       'X161_DE_time', 'X161_FE_time', 'X161RPM', 'X162_DE_time',\n",
       "       'X162_FE_time', 'X162RPM', 'X163_DE_time', 'X163_FE_time',\n",
       "       'X163RPM', 'X164_DE_time', 'X164_FE_time', 'X164RPM',\n",
       "       'X262_DE_time', 'X262_FE_time', 'X262RPM', 'X263_DE_time',\n",
       "       'X263_FE_time', 'X263RPM', 'X264_DE_time', 'X264_FE_time',\n",
       "       'X264RPM', 'X265_DE_time', 'X265_FE_time', 'X265RPM',\n",
       "       'X148_DE_time', 'X148_FE_time', 'X148RPM', 'X149_DE_time',\n",
       "       'X149_FE_time', 'X149RPM', 'X150_DE_time', 'X150_FE_time',\n",
       "       'X150RPM', 'X151_DE_time', 'X151_FE_time', 'X151RPM',\n",
       "       'X250_DE_time', 'X250_FE_time', 'X250RPM', 'X251_DE_time',\n",
       "       'X251_FE_time', 'X251RPM', 'X252_DE_time', 'X252_FE_time',\n",
       "       'X252RPM', 'X253_DE_time', 'X253_FE_time', 'X253RPM',\n",
       "       'X097_DE_time', 'X097_FE_time', 'X097RPM', 'X098_DE_time',\n",
       "       'X098_FE_time', 'X099_DE_time', 'X099_FE_time', 'X100_DE_time',\n",
       "       'X100_FE_time', 'X100RPM'], dtype=object)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['variable'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "75381826-5e45-46a7-951a-fd4f9164c72a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>variable</th>\n",
       "      <th>data_id</th>\n",
       "      <th>feature</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>X118_DE_time</td>\n",
       "      <td>X118</td>\n",
       "      <td>_DE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>X118_FE_time</td>\n",
       "      <td>X118</td>\n",
       "      <td>_FE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>X118_BA_time</td>\n",
       "      <td>X118</td>\n",
       "      <td>_BA_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>X118RPM</td>\n",
       "      <td>X118</td>\n",
       "      <td>RPM</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>X119_DE_time</td>\n",
       "      <td>X119</td>\n",
       "      <td>_DE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>X119_FE_time</td>\n",
       "      <td>X119</td>\n",
       "      <td>_FE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>X119_BA_time</td>\n",
       "      <td>X119</td>\n",
       "      <td>_BA_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>X119RPM</td>\n",
       "      <td>X119</td>\n",
       "      <td>RPM</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>X120_DE_time</td>\n",
       "      <td>X120</td>\n",
       "      <td>_DE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>X120_FE_time</td>\n",
       "      <td>X120</td>\n",
       "      <td>_FE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>X120_BA_time</td>\n",
       "      <td>X120</td>\n",
       "      <td>_BA_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>X120RPM</td>\n",
       "      <td>X120</td>\n",
       "      <td>RPM</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>X121_DE_time</td>\n",
       "      <td>X121</td>\n",
       "      <td>_DE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>X121_FE_time</td>\n",
       "      <td>X121</td>\n",
       "      <td>_FE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>X121_BA_time</td>\n",
       "      <td>X121</td>\n",
       "      <td>_BA_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>X121RPM</td>\n",
       "      <td>X121</td>\n",
       "      <td>RPM</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>X185_DE_time</td>\n",
       "      <td>X185</td>\n",
       "      <td>_DE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>X185_FE_time</td>\n",
       "      <td>X185</td>\n",
       "      <td>_FE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>X185_BA_time</td>\n",
       "      <td>X185</td>\n",
       "      <td>_BA_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>X185RPM</td>\n",
       "      <td>X185</td>\n",
       "      <td>RPM</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        variable data_id   feature\n",
       "0   X118_DE_time    X118  _DE_time\n",
       "1   X118_FE_time    X118  _FE_time\n",
       "2   X118_BA_time    X118  _BA_time\n",
       "3        X118RPM    X118       RPM\n",
       "4   X119_DE_time    X119  _DE_time\n",
       "5   X119_FE_time    X119  _FE_time\n",
       "6   X119_BA_time    X119  _BA_time\n",
       "7        X119RPM    X119       RPM\n",
       "8   X120_DE_time    X120  _DE_time\n",
       "9   X120_FE_time    X120  _FE_time\n",
       "10  X120_BA_time    X120  _BA_time\n",
       "11       X120RPM    X120       RPM\n",
       "12  X121_DE_time    X121  _DE_time\n",
       "13  X121_FE_time    X121  _FE_time\n",
       "14  X121_BA_time    X121  _BA_time\n",
       "15       X121RPM    X121       RPM\n",
       "16  X185_DE_time    X185  _DE_time\n",
       "17  X185_FE_time    X185  _FE_time\n",
       "18  X185_BA_time    X185  _BA_time\n",
       "19       X185RPM    X185       RPM"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 拆分 variable，提取数据编号和特征类型\n",
    "df['data_id'] = df['variable'].str.extract(r'(X\\d+)')   # 数据编号，如 X118\n",
    "df['feature'] = df['variable'].str.replace(r'X\\d+', '', regex=True)  # 剔除编号，保留特征\n",
    "\n",
    "# 统计剔除编号后的唯一特征数\n",
    "unique_features = df['feature'].unique()\n",
    "num_unique_features = len(unique_features)\n",
    "\n",
    "df[['variable', 'data_id', 'feature']].head(20)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "4778676f-027f-4d20-8ba2-eff0a3c7c73f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "num_unique_features"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "0c3688b2-8fd5-4c55-a2f5-7400688b8cc8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['_DE_time', '_FE_time', '_BA_time', 'RPM'], dtype=object)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "unique_features"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "9d1ce4ef-aaa5-47a1-82e6-a11ef2ab0276",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "file\n",
       "源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat                   4\n",
       "源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat                   4\n",
       "源域数据集\\12kHz_DE_data\\B\\0007\\B007_2.mat                   4\n",
       "源域数据集\\12kHz_DE_data\\B\\0007\\B007_3.mat                   4\n",
       "源域数据集\\12kHz_DE_data\\B\\0014\\B014_0.mat                   4\n",
       "                                                       ..\n",
       "源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_3.mat    3\n",
       "源域数据集\\48kHz_Normal_data\\N_0.mat                         3\n",
       "源域数据集\\48kHz_Normal_data\\N_1_(1772rpm).mat               2\n",
       "源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat               2\n",
       "源域数据集\\48kHz_Normal_data\\N_3.mat                         3\n",
       "Name: feature, Length: 161, dtype: int64"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby('file')['feature'].count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "7f1d758d-d671-478c-b99e-562c1e93c34c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([4, 1, 3, 2], dtype=int64)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby('file')['feature'].count().unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "0265fc0c-3390-47aa-8d44-79017815adba",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "file\n",
       "源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat                   4\n",
       "源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat                   4\n",
       "源域数据集\\12kHz_DE_data\\B\\0007\\B007_2.mat                   4\n",
       "源域数据集\\12kHz_DE_data\\B\\0007\\B007_3.mat                   4\n",
       "源域数据集\\12kHz_DE_data\\B\\0014\\B014_0.mat                   4\n",
       "                                                       ..\n",
       "源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3_3.mat    3\n",
       "源域数据集\\48kHz_Normal_data\\N_0.mat                         3\n",
       "源域数据集\\48kHz_Normal_data\\N_1_(1772rpm).mat               2\n",
       "源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat               2\n",
       "源域数据集\\48kHz_Normal_data\\N_3.mat                         3\n",
       "Name: feature, Length: 161, dtype: int64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby('file')['feature'].count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "508b7c60-b3f0-493f-9a6b-ea734d8a6f6d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>file</th>\n",
       "      <th>variable</th>\n",
       "      <th>samples</th>\n",
       "      <th>columns</th>\n",
       "      <th>data_id</th>\n",
       "      <th>feature</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>X118_DE_time</td>\n",
       "      <td>96000</td>\n",
       "      <td>1</td>\n",
       "      <td>X118</td>\n",
       "      <td>_DE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>X118_FE_time</td>\n",
       "      <td>96000</td>\n",
       "      <td>1</td>\n",
       "      <td>X118</td>\n",
       "      <td>_FE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>X118_BA_time</td>\n",
       "      <td>96000</td>\n",
       "      <td>1</td>\n",
       "      <td>X118</td>\n",
       "      <td>_BA_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>X118RPM</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>X118</td>\n",
       "      <td>RPM</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat</td>\n",
       "      <td>X119_DE_time</td>\n",
       "      <td>96000</td>\n",
       "      <td>1</td>\n",
       "      <td>X119</td>\n",
       "      <td>_DE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>557</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat</td>\n",
       "      <td>X099_DE_time</td>\n",
       "      <td>384000</td>\n",
       "      <td>1</td>\n",
       "      <td>X099</td>\n",
       "      <td>_DE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>558</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat</td>\n",
       "      <td>X099_FE_time</td>\n",
       "      <td>384000</td>\n",
       "      <td>1</td>\n",
       "      <td>X099</td>\n",
       "      <td>_FE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>559</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>X100_DE_time</td>\n",
       "      <td>384000</td>\n",
       "      <td>1</td>\n",
       "      <td>X100</td>\n",
       "      <td>_DE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>560</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>X100_FE_time</td>\n",
       "      <td>384000</td>\n",
       "      <td>1</td>\n",
       "      <td>X100</td>\n",
       "      <td>_FE_time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>561</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>X100RPM</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>X100</td>\n",
       "      <td>RPM</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>562 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                          file      variable  samples  \\\n",
       "0        源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat  X118_DE_time    96000   \n",
       "1        源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat  X118_FE_time    96000   \n",
       "2        源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat  X118_BA_time    96000   \n",
       "3        源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat       X118RPM        1   \n",
       "4        源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat  X119_DE_time    96000   \n",
       "..                                         ...           ...      ...   \n",
       "557  源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat  X099_DE_time   384000   \n",
       "558  源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat  X099_FE_time   384000   \n",
       "559            源域数据集\\48kHz_Normal_data\\N_3.mat  X100_DE_time   384000   \n",
       "560            源域数据集\\48kHz_Normal_data\\N_3.mat  X100_FE_time   384000   \n",
       "561            源域数据集\\48kHz_Normal_data\\N_3.mat       X100RPM        1   \n",
       "\n",
       "     columns data_id   feature  \n",
       "0          1    X118  _DE_time  \n",
       "1          1    X118  _FE_time  \n",
       "2          1    X118  _BA_time  \n",
       "3          1    X118       RPM  \n",
       "4          1    X119  _DE_time  \n",
       "..       ...     ...       ...  \n",
       "557        1    X099  _DE_time  \n",
       "558        1    X099  _FE_time  \n",
       "559        1    X100  _DE_time  \n",
       "560        1    X100  _FE_time  \n",
       "561        1    X100       RPM  \n",
       "\n",
       "[562 rows x 6 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "8b17b865-fdc6-4674-bdba-ee214084d982",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('B', 0.007, None, 0, 'B007_0', '源域数据集\\\\12kHz_DE_data\\\\B\\\\0007\\\\B007_0.mat'),\n",
       " ('B', 0.007, None, 1, 'B007_1', '源域数据集\\\\12kHz_DE_data\\\\B\\\\0007\\\\B007_1.mat'),\n",
       " ('B', 0.007, None, 2, 'B007_2', '源域数据集\\\\12kHz_DE_data\\\\B\\\\0007\\\\B007_2.mat'),\n",
       " ('B', 0.007, None, 3, 'B007_3', '源域数据集\\\\12kHz_DE_data\\\\B\\\\0007\\\\B007_3.mat'),\n",
       " ('B', 0.014, None, 0, 'B014_0', '源域数据集\\\\12kHz_DE_data\\\\B\\\\0014\\\\B014_0.mat')]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import re\n",
    "\n",
    "\n",
    "# helper: parse fields from filename\n",
    "def parse_from_file(path):\n",
    "    # normalize slashes\n",
    "    p = path.replace(\"\\\\\", \"/\")\n",
    "    fname = p.split(\"/\")[-1]  # e.g., B007_0.mat\n",
    "    stem = fname.replace(\".mat\", \"\")\n",
    "    # status letter at start (B/IR/OR/N). Some may be 'IR', 'OR', 'N' prefix\n",
    "    status = None\n",
    "    size = None\n",
    "    load = None\n",
    "    pos = None\n",
    "    \n",
    "    # try IR/OR/B/N prefix\n",
    "    m = re.match(r\"(IR|OR|B|N)(\\d{3})?_(\\d)\", stem)\n",
    "    if m:\n",
    "        status = m.group(1)\n",
    "        size = m.group(2)\n",
    "        load = m.group(3)\n",
    "    \n",
    "    # Position clues in path (for OR only): look for Orth, Center, Opposite, or numerals 3,6,12-like tokens\n",
    "    p_lower = p.lower()\n",
    "    if status == \"OR\":\n",
    "        if any(k in p_lower for k in [\"orth\", \"3\"]) and \"12\" not in p_lower and \"6\" not in p_lower:\n",
    "            pos = \"Orthogonal(3 o'clock)\"\n",
    "        elif \"center\" in p_lower or \"/6\" in p_lower or \"_6\" in p_lower:\n",
    "            pos = \"Centered(6 o'clock)\"\n",
    "        elif \"oppo\" in p_lower or \"12\" in p_lower:\n",
    "            pos = \"Opposite(12 o'clock)\"\n",
    "    \n",
    "    # map size\n",
    "    size_inch = None\n",
    "    if size is not None:\n",
    "        try:\n",
    "            size_inch = float(size)/1000.0  # 007 -> 0.007 inches\n",
    "        except:\n",
    "            size_inch = None\n",
    "    \n",
    "    # load as int\n",
    "    load_hp = int(load) if load is not None else None\n",
    "    \n",
    "    return status, size_inch, pos, load_hp, stem\n",
    "\n",
    "# test on a few unique file paths\n",
    "sample_paths = df['file'].drop_duplicates().head(20).tolist()\n",
    "parsed_samples = [(*parse_from_file(p), p) for p in sample_paths]\n",
    "parsed_samples[:5]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fb6bbaf3-5a62-441f-a491-95374e5a15e3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "108d1d9c-8ae4-4e25-9e81-974d2bed5015",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "大宽表维度： (161, 10)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>file</th>\n",
       "      <th>status</th>\n",
       "      <th>fault_size_inch</th>\n",
       "      <th>position</th>\n",
       "      <th>load</th>\n",
       "      <th>data_id</th>\n",
       "      <th>DE_time</th>\n",
       "      <th>FE_time</th>\n",
       "      <th>BA_time</th>\n",
       "      <th>RPM</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>[[0.19612209317762153], [-0.010495391852318566...</td>\n",
       "      <td>[[-0.07096593870268883], [0.12668133402458392]...</td>\n",
       "      <td>[[-0.013883012957765627], [-0.0583453274978249...</td>\n",
       "      <td>[[1796]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>1.0</td>\n",
       "      <td>X119</td>\n",
       "      <td>[[0.16097982148905385], [-0.11710912062671461]...</td>\n",
       "      <td>[[0.0023566572170930986], [-0.0216815246010887...</td>\n",
       "      <td>[[-0.02494944028144085], [-0.0365378082339631]...</td>\n",
       "      <td>[[1772]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_2.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>2.0</td>\n",
       "      <td>X120</td>\n",
       "      <td>[[-0.101050582052191], [-0.13028890540548438],...</td>\n",
       "      <td>[[0.09832122634087093], [0.03072668088632549],...</td>\n",
       "      <td>[[0.07479378686435131], [0.07934061179016733],...</td>\n",
       "      <td>[[1748]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0007\\B007_3.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X121</td>\n",
       "      <td>[[-0.16744701037262077], [-0.15006645149038525...</td>\n",
       "      <td>[[-0.011039407590665285], [0.04217331968206199...</td>\n",
       "      <td>[[0.009824349258423883], [0.021493191988394212...</td>\n",
       "      <td>[[1722]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>源域数据集\\12kHz_DE_data\\B\\0014\\B014_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.014</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X185</td>\n",
       "      <td>[[0.11470197259011841], [-0.19165068210050032]...</td>\n",
       "      <td>[[0.47692705946254066], [0.2692125140079952], ...</td>\n",
       "      <td>[[0.024658354915196502], [-0.00346757980290439...</td>\n",
       "      <td>[[1796]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3...</td>\n",
       "      <td>OR</td>\n",
       "      <td>0.021</td>\n",
       "      <td>Orthogonal</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X253</td>\n",
       "      <td>[[-0.4945780919399304], [-0.3059434252732638],...</td>\n",
       "      <td>[[-0.0817050953713713], [-0.05622246910874503]...</td>\n",
       "      <td>None</td>\n",
       "      <td>[[1719]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>157</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_0.mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X097</td>\n",
       "      <td>[[0.04063871187697756], [0.07610332726159295],...</td>\n",
       "      <td>[[0.11429145841081825], [0.06642054931990916],...</td>\n",
       "      <td>None</td>\n",
       "      <td>[[1796]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_1_(1772rpm).mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>X098</td>\n",
       "      <td>[[0.06483220523884395], [0.05940820523884394],...</td>\n",
       "      <td>[[0.06254474392219478], [0.021659289376740228]...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>X099</td>\n",
       "      <td>[[0.09934862958419834], [0.0688907834303522], ...</td>\n",
       "      <td>[[-0.07860067645196228], [-0.05415158554287136...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160</th>\n",
       "      <td>源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X100</td>\n",
       "      <td>[[-0.014753283453705076], [-0.0825532834537050...</td>\n",
       "      <td>[[-0.06127647053494027], [-0.02984192508039482...</td>\n",
       "      <td>None</td>\n",
       "      <td>[[1725]]</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>161 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  file status  \\\n",
       "0                源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B   \n",
       "1                源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat      B   \n",
       "2                源域数据集\\12kHz_DE_data\\B\\0007\\B007_2.mat      B   \n",
       "3                源域数据集\\12kHz_DE_data\\B\\0007\\B007_3.mat      B   \n",
       "4                源域数据集\\12kHz_DE_data\\B\\0014\\B014_0.mat      B   \n",
       "..                                                 ...    ...   \n",
       "156  源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021\\OR021@3...     OR   \n",
       "157                    源域数据集\\48kHz_Normal_data\\N_0.mat      N   \n",
       "158          源域数据集\\48kHz_Normal_data\\N_1_(1772rpm).mat      N   \n",
       "159          源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat      N   \n",
       "160                    源域数据集\\48kHz_Normal_data\\N_3.mat      N   \n",
       "\n",
       "     fault_size_inch    position  load data_id  \\\n",
       "0              0.007        None   0.0    X118   \n",
       "1              0.007        None   1.0    X119   \n",
       "2              0.007        None   2.0    X120   \n",
       "3              0.007        None   3.0    X121   \n",
       "4              0.014        None   0.0    X185   \n",
       "..               ...         ...   ...     ...   \n",
       "156            0.021  Orthogonal   3.0    X253   \n",
       "157            0.000        None   0.0    X097   \n",
       "158            0.000        None   NaN    X098   \n",
       "159            0.000        None   NaN    X099   \n",
       "160            0.000        None   3.0    X100   \n",
       "\n",
       "                                               DE_time  \\\n",
       "0    [[0.19612209317762153], [-0.010495391852318566...   \n",
       "1    [[0.16097982148905385], [-0.11710912062671461]...   \n",
       "2    [[-0.101050582052191], [-0.13028890540548438],...   \n",
       "3    [[-0.16744701037262077], [-0.15006645149038525...   \n",
       "4    [[0.11470197259011841], [-0.19165068210050032]...   \n",
       "..                                                 ...   \n",
       "156  [[-0.4945780919399304], [-0.3059434252732638],...   \n",
       "157  [[0.04063871187697756], [0.07610332726159295],...   \n",
       "158  [[0.06483220523884395], [0.05940820523884394],...   \n",
       "159  [[0.09934862958419834], [0.0688907834303522], ...   \n",
       "160  [[-0.014753283453705076], [-0.0825532834537050...   \n",
       "\n",
       "                                               FE_time  \\\n",
       "0    [[-0.07096593870268883], [0.12668133402458392]...   \n",
       "1    [[0.0023566572170930986], [-0.0216815246010887...   \n",
       "2    [[0.09832122634087093], [0.03072668088632549],...   \n",
       "3    [[-0.011039407590665285], [0.04217331968206199...   \n",
       "4    [[0.47692705946254066], [0.2692125140079952], ...   \n",
       "..                                                 ...   \n",
       "156  [[-0.0817050953713713], [-0.05622246910874503]...   \n",
       "157  [[0.11429145841081825], [0.06642054931990916],...   \n",
       "158  [[0.06254474392219478], [0.021659289376740228]...   \n",
       "159  [[-0.07860067645196228], [-0.05415158554287136...   \n",
       "160  [[-0.06127647053494027], [-0.02984192508039482...   \n",
       "\n",
       "                                               BA_time       RPM  \n",
       "0    [[-0.013883012957765627], [-0.0583453274978249...  [[1796]]  \n",
       "1    [[-0.02494944028144085], [-0.0365378082339631]...  [[1772]]  \n",
       "2    [[0.07479378686435131], [0.07934061179016733],...  [[1748]]  \n",
       "3    [[0.009824349258423883], [0.021493191988394212...  [[1722]]  \n",
       "4    [[0.024658354915196502], [-0.00346757980290439...  [[1796]]  \n",
       "..                                                 ...       ...  \n",
       "156                                               None  [[1719]]  \n",
       "157                                               None  [[1796]]  \n",
       "158                                               None      None  \n",
       "159                                               None      None  \n",
       "160                                               None  [[1725]]  \n",
       "\n",
       "[161 rows x 10 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"\"\"\n",
    "将 df['file'] 指向的每个 .mat 文件读取为 4 个统一特征（DE_time, FE_time, BA_time, RPM），\n",
    "按文件逐一合并为一个“大宽表”。若某文件缺少某特征则填空；若缺少 RPM，则由文件名/目录中的载荷推断并填充典型 RPM。\n",
    "输出字段：\n",
    "1) file（文件绝对路径）\n",
    "2) status（B/IR/OR/N）\n",
    "3) fault_size_inch（故障尺寸，单位英寸；正常样本为 0 或 None）\n",
    "4) position（仅 OR 有：Orthogonal=3点钟 / Centered=6点钟 / Opposite=12点钟）\n",
    "5) load（0/1/2/3）\n",
    "6) data_id（如 X118）\n",
    "7) DE_time / FE_time / BA_time / RPM（对应数组，RPM 为 shape (1,1)）\n",
    "\"\"\"\n",
    "\n",
    "import re\n",
    "from pathlib import Path\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import scipy.io as sio\n",
    "\n",
    "# 如果你已经有 df（包含列 file, variable, samples, columns），可跳过这行读取：\n",
    "# df = pd.read_csv(\"df.csv\")  # file 列应为绝对路径\n",
    "\n",
    "# --- 解析辅助函数 -----------------------------------------------------------------\n",
    "\n",
    "def parse_status_size_load_position_from_path(path_str: str):\n",
    "    \"\"\"\n",
    "    从文件路径/文件名中解析：\n",
    "      - status: B / IR / OR / N\n",
    "      - fault_size_inch: 0.007 等（英寸）；正常样本返回 0 或 None\n",
    "      - position: 仅 OR 有，3->Orthogonal, 6->Centered, 12->Opposite\n",
    "      - load: 0/1/2/3\n",
    "    兼容多种常见命名：如 B007_0.mat、IR021_2.mat、OR014@6_1.mat、OR021_12_3.mat、Normal_0.mat，\n",
    "    以及目录中包含状态/载荷（如 .../OR/.../@6/.../2/...）\n",
    "    \"\"\"\n",
    "    p = Path(path_str)\n",
    "    name = p.stem  # 文件名(无扩展)\n",
    "    up = name.upper()\n",
    "\n",
    "    parts_upper = [s.upper() for s in p.parts]\n",
    "\n",
    "    # 1) status\n",
    "    status = None\n",
    "    # 先看文件名前缀\n",
    "    if up.startswith(\"IR\"):\n",
    "        status = \"IR\"\n",
    "    elif up.startswith(\"OR\"):\n",
    "        status = \"OR\"\n",
    "    elif up.startswith(\"B\"):\n",
    "        status = \"B\"\n",
    "    elif up.startswith(\"N\") or \"NORMAL\" in up:\n",
    "        status = \"N\"\n",
    "    # 再从目录兜底\n",
    "    if status is None:\n",
    "        if any(seg in {\"IR\", \"INNER\", \"INNER_RACE\"} for seg in parts_upper):\n",
    "            status = \"IR\"\n",
    "        elif any(seg in {\"OR\", \"OUTER\", \"OUTER_RACE\"} for seg in parts_upper):\n",
    "            status = \"OR\"\n",
    "        elif any(seg in {\"B\", \"BALL\"} for seg in parts_upper):\n",
    "            status = \"B\"\n",
    "        elif any(\"NORMAL\" in seg or seg == \"N\" for seg in parts_upper):\n",
    "            status = \"N\"\n",
    "\n",
    "    # 2) fault size（仅 B/IR/OR 有）\n",
    "    fault_size_inch = None\n",
    "    m_size = re.search(r'(?:B|IR|OR)(\\d{3})', up)\n",
    "    if m_size:\n",
    "        fault_size_inch = int(m_size.group(1)) / 1000.0\n",
    "    elif status == \"N\":\n",
    "        fault_size_inch = 0.0\n",
    "\n",
    "    # 3) position（仅 OR 有且可能包含 3/6/12）\n",
    "    # 兼容 OR014@6_1 / OR014_6_1 / OR014-6-1，以及目录中包含 '3','6','12'\n",
    "    position = None\n",
    "    if status == \"OR\":\n",
    "        m_pos = re.search(r'OR\\d{3}[@_\\-]?(\\d{1,2})', up)\n",
    "        pos_val = None\n",
    "        if m_pos:\n",
    "            pos_val = m_pos.group(1)\n",
    "        else:\n",
    "            # 目录兜底：若路径中包含 3/6/12 且离 OR 最近的数字\n",
    "            # 简化处理：路径任何一段是 '3','6','12' 就认\n",
    "            candidates = {seg for seg in parts_upper if seg in {\"3\", \"6\", \"12\"}}\n",
    "            if \"12\" in candidates:\n",
    "                pos_val = \"12\"\n",
    "            elif \"6\" in candidates:\n",
    "                pos_val = \"6\"\n",
    "            elif \"3\" in candidates:\n",
    "                pos_val = \"3\"\n",
    "\n",
    "        if pos_val in {\"3\", \"6\", \"12\"}:\n",
    "            if pos_val == \"3\":\n",
    "                position = \"Orthogonal\"  # 3 点钟\n",
    "            elif pos_val == \"6\":\n",
    "                position = \"Centered\"    # 6 点钟\n",
    "            elif pos_val == \"12\":\n",
    "                position = \"Opposite\"    # 12 点钟\n",
    "\n",
    "    # 4) load（优先文件名下划线后的尾数；兜底从目录判断）\n",
    "    load = None\n",
    "    m_load = re.search(r'_(\\d)(?:\\.MAT)?$', up)\n",
    "    if m_load:\n",
    "        load = int(m_load.group(1))\n",
    "    else:\n",
    "        # 目录兜底：常见路径含 0/1/2/3 目录段\n",
    "        for seg in reversed(parts_upper):\n",
    "            if seg in {\"0\", \"1\", \"2\", \"3\"}:\n",
    "                load = int(seg)\n",
    "                break\n",
    "\n",
    "    return status, fault_size_inch, position, load\n",
    "\n",
    "\n",
    "def infer_rpm_from_load(load: int, fs_hint: str = \"\") -> int:\n",
    "    \"\"\"\n",
    "    根据 12kHz CWRU 常见映射推断 RPM。\n",
    "    载荷 0/1/2/3 -> 1797 / 1772 / 1750 / 1730\n",
    "    若识别不到载荷，则返回 None。\n",
    "    \"\"\"\n",
    "    # 也可在此根据路径包含 '48kHz' 等加以区分；RPM 本身与采样频率无关，这里使用通用典型值\n",
    "    rpm_map = {0: 1797, 1: 1772, 2: 1750, 3: 1730}\n",
    "    if load in rpm_map:\n",
    "        return rpm_map[load]\n",
    "    return None\n",
    "\n",
    "\n",
    "def extract_data_id(var_names):\n",
    "    \"\"\"\n",
    "    从变量名列表中提取数据编号（如 'X118'）。若多项一致返回该编号，否则返回第一个匹配。\n",
    "    \"\"\"\n",
    "    for k in var_names:\n",
    "        m = re.search(r'(X\\d+)', k)\n",
    "        if m:\n",
    "            return m.group(1)\n",
    "    return None\n",
    "\n",
    "\n",
    "def load_mat_signals_to_features(mat_path: str):\n",
    "    \"\"\"\n",
    "    读取 .mat 文件并返回统一特征 dict：\n",
    "      {'DE_time': ndarray or None, 'FE_time': ndarray or None,\n",
    "       'BA_time': ndarray or None, 'RPM': ndarray or None}, 以及 data_id\n",
    "    自动从变量名中识别 X###_DE_time / X###_FE_time / X###_BA_time / X###RPM\n",
    "    \"\"\"\n",
    "    mat = sio.loadmat(mat_path)\n",
    "    keys = [k for k in mat.keys() if not k.startswith(\"__\")]\n",
    "\n",
    "    features = {\"DE_time\": None, \"FE_time\": None, \"BA_time\": None, \"RPM\": None}\n",
    "    data_id = extract_data_id(keys)\n",
    "\n",
    "    for k in keys:\n",
    "        upk = k.upper()\n",
    "        # 匹配 *_DE_time\n",
    "        if re.search(r'_DE_TIME$', upk):\n",
    "            features[\"DE_time\"] = mat[k]\n",
    "        elif re.search(r'_FE_TIME$', upk):\n",
    "            features[\"FE_time\"] = mat[k]\n",
    "        elif re.search(r'_BA_TIME$', upk):\n",
    "            features[\"BA_time\"] = mat[k]\n",
    "        elif re.search(r'RPM$', upk):\n",
    "            # RPM 统一为 shape (1,1)\n",
    "            v = mat[k]\n",
    "            v = np.array(v)\n",
    "            if v.size == 1:\n",
    "                v = v.reshape(1, 1)\n",
    "            features[\"RPM\"] = v\n",
    "\n",
    "    return features, data_id\n",
    "\n",
    "\n",
    "# --- 主流程：逐文件构建“小框表”并纵向拼接为“大宽表” -------------------------------\n",
    "\n",
    "rows = []\n",
    "unique_files = df[\"file\"].unique()\n",
    "\n",
    "for fpath in unique_files:\n",
    "    # 解析元数据\n",
    "    status, fault_size_inch, position, load = parse_status_size_load_position_from_path(fpath)\n",
    "\n",
    "    # 读取特征\n",
    "    try:\n",
    "        feats, data_id = load_mat_signals_to_features(fpath)\n",
    "    except Exception as e:\n",
    "        # 若文件读取失败，构造空行以便后续排查\n",
    "        feats = {\"DE_time\": None, \"FE_time\": None, \"BA_time\": None, \"RPM\": None}\n",
    "        data_id = None\n",
    "        print(f\"[WARN] 读取失败: {fpath} | {e}\")\n",
    "\n",
    "    # 若 RPM 缺失且能根据载荷推断，则补齐（shape 1x1）\n",
    "    if feats[\"RPM\"] is None and load is not None:\n",
    "        rpm_val = infer_rpm_from_load(load)\n",
    "        if rpm_val is not None:\n",
    "            feats[\"RPM\"] = np.array([[rpm_val]])\n",
    "\n",
    "    # 组装一行\n",
    "    row = {\n",
    "        \"file\": fpath,\n",
    "        \"status\": status,\n",
    "        \"fault_size_inch\": fault_size_inch,\n",
    "        \"position\": position,   # OR 才有；其他状态为 None\n",
    "        \"load\": load,\n",
    "        \"data_id\": data_id,\n",
    "        \"DE_time\": feats[\"DE_time\"],\n",
    "        \"FE_time\": feats[\"FE_time\"],\n",
    "        \"BA_time\": feats[\"BA_time\"],\n",
    "        \"RPM\": feats[\"RPM\"],\n",
    "    }\n",
    "    rows.append(row)\n",
    "\n",
    "# 合并为大宽表\n",
    "wide_df = pd.DataFrame(rows, columns=[\n",
    "    \"file\", \"status\", \"fault_size_inch\", \"position\", \"load\", \"data_id\",\n",
    "    \"DE_time\", \"FE_time\", \"BA_time\", \"RPM\"\n",
    "])\n",
    "\n",
    "# 可选：保存（注意数组会以对象形式存储在 CSV 中不友好；建议保存为 pickle 或 parquet）\n",
    "# wide_df.to_pickle(\"wide_df.pkl\")\n",
    "# wide_df.to_parquet(\"wide_df.parquet\")\n",
    "\n",
    "# 打印概要\n",
    "print(\"大宽表维度：\", wide_df.shape)\n",
    "wide_df\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "fcff8289-3ddc-4636-8519-5a33d5c64d09",
   "metadata": {},
   "outputs": [],
   "source": [
    "wide_df.to_csv('data.csv',index=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "70895d2d-7687-4b8f-8761-1d54dd5767a8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(256000,)\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from scipy.signal import resample\n",
    "\n",
    "def resample_to_8s_32k(x, fs_in, target_fs=32000, target_dur=8.0):\n",
    "    \"\"\"重采样信号到目标采样率和时长\"\"\"\n",
    "    if x is None:\n",
    "        return None\n",
    "    x = np.array(x).reshape(-1)\n",
    "\n",
    "    target_len = int(target_fs * target_dur)\n",
    "    n_samples = int(len(x) * target_fs / fs_in)\n",
    "\n",
    "    # 重采样\n",
    "    x_resampled = resample(x, n_samples)\n",
    "\n",
    "    # 对齐长度\n",
    "    if len(x_resampled) > target_len:\n",
    "        return x_resampled[:target_len]\n",
    "    elif len(x_resampled) < target_len:\n",
    "        return np.pad(x_resampled, (0, target_len - len(x_resampled)))\n",
    "    else:\n",
    "        return x_resampled\n",
    "\n",
    "def infer_fs(row):\n",
    "    \"\"\"推断采样率\"\"\"\n",
    "    path = str(row[\"file\"]).lower()\n",
    "    if \"12khz\" in path:\n",
    "        return 12000\n",
    "    if \"48khz\" in path:\n",
    "        return 48000\n",
    "\n",
    "    # fallback: 用长度推断\n",
    "    for sig in [\"DE_time\", \"FE_time\", \"BA_time\"]:\n",
    "        arr = row.get(sig, None)\n",
    "        if arr is not None:\n",
    "            n = len(arr)\n",
    "            if 90000 <= n <= 110000:\n",
    "                return 12000\n",
    "            if 350000 <= n <= 410000:\n",
    "                return 48000\n",
    "    return None\n",
    "\n",
    "def process_source_wide(wide_df):\n",
    "    processed = []\n",
    "    for _, row in wide_df.iterrows():\n",
    "        fs_in = infer_fs(row)\n",
    "        if fs_in is None:\n",
    "            print(f\"[WARN] 仍无法推断采样率：{row['file']}\")\n",
    "            continue\n",
    "\n",
    "        de_new = resample_to_8s_32k(row.get(\"DE_time\"), fs_in)\n",
    "        fe_new = resample_to_8s_32k(row.get(\"FE_time\"), fs_in)\n",
    "        ba_new = resample_to_8s_32k(row.get(\"BA_time\"), fs_in)\n",
    "\n",
    "        processed.append({\n",
    "            \"file\": row[\"file\"],\n",
    "            \"status\": row[\"status\"],\n",
    "            \"fault_size_inch\": row[\"fault_size_inch\"],\n",
    "            \"position\": row[\"position\"],\n",
    "            \"load\": row[\"load\"],\n",
    "            \"data_id\": row[\"data_id\"],\n",
    "            \"DE_time\": de_new,\n",
    "            \"FE_time\": fe_new,\n",
    "            \"BA_time\": ba_new,\n",
    "            \"RPM\": row[\"RPM\"],\n",
    "        })\n",
    "\n",
    "    return pd.DataFrame(processed, columns=wide_df.columns)\n",
    "\n",
    "# 使用：\n",
    "new_wide_df = process_source_wide(wide_df)\n",
    "print(new_wide_df.iloc[0][\"DE_time\"].shape)  # (256000,)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "81c61b76-2735-426f-b02f-39a8a40fbeaf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>file</th>\n",
       "      <th>status</th>\n",
       "      <th>fault_size_inch</th>\n",
       "      <th>position</th>\n",
       "      <th>load</th>\n",
       "      <th>data_id</th>\n",
       "      <th>DE_time</th>\n",
       "      <th>FE_time</th>\n",
       "      <th>BA_time</th>\n",
       "      <th>RPM</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>[0.19612209317762144, 0.16008970204355277, 0.0...</td>\n",
       "      <td>[-0.0709659387026888, 0.0028282335393879712, 0...</td>\n",
       "      <td>[-0.01388301295776563, -0.027342452309716176, ...</td>\n",
       "      <td>[[1796]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>1.0</td>\n",
       "      <td>X119</td>\n",
       "      <td>[0.16097982148905388, 0.08994307645566291, -0....</td>\n",
       "      <td>[0.002356657217093115, 0.009813850877018462, -...</td>\n",
       "      <td>[-0.024949440281440832, -0.030069670638140623,...</td>\n",
       "      <td>[[1772]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_2.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>2.0</td>\n",
       "      <td>X120</td>\n",
       "      <td>[-0.10105058205219097, -0.1803892187999539, -0...</td>\n",
       "      <td>[0.09832122634087093, 0.07490081209805338, 0.0...</td>\n",
       "      <td>[0.07479378686435133, 0.08153788226372499, 0.0...</td>\n",
       "      <td>[[1748]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_3.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X121</td>\n",
       "      <td>[-0.1674470103726208, -0.24771332064334256, -0...</td>\n",
       "      <td>[-0.011039407590665271, 0.03355396270934144, 0...</td>\n",
       "      <td>[0.00982434925842389, 0.015140455052197322, 0....</td>\n",
       "      <td>[[1722]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0014\\B014_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.014</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X185</td>\n",
       "      <td>[0.11470197259011836, -0.04296683269814328, -0...</td>\n",
       "      <td>[0.47692705946254066, 0.5432731243039921, 0.42...</td>\n",
       "      <td>[0.024658354915196527, 0.017851081830905568, 0...</td>\n",
       "      <td>[[1796]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021...</td>\n",
       "      <td>OR</td>\n",
       "      <td>0.021</td>\n",
       "      <td>Orthogonal</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X253</td>\n",
       "      <td>[-0.33555718272074553, -0.25088754945955116, 0...</td>\n",
       "      <td>[0.007795672496417106, -0.05681913033861125, 0...</td>\n",
       "      <td>None</td>\n",
       "      <td>[[1719]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>157</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_0.mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X097</td>\n",
       "      <td>[0.04457122843112234, 0.08584069556121486, 0.0...</td>\n",
       "      <td>[0.1026598048633869, 0.044021890210924744, 0.0...</td>\n",
       "      <td>None</td>\n",
       "      <td>[[1796]]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_1_(1772rpm).mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>X098</td>\n",
       "      <td>[0.04554089281594434, 0.059045673364322204, -0...</td>\n",
       "      <td>[0.04473781858064439, 0.0050140265735961215, -...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>X099</td>\n",
       "      <td>[0.09153398120789524, 0.05861900407537136, 0.0...</td>\n",
       "      <td>[-0.05172357147854265, -0.03727567396030442, 0...</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X100</td>\n",
       "      <td>[-0.0004271474948197967, -0.11419057440928315,...</td>\n",
       "      <td>[-0.05327251873971267, -0.009675485238823481, ...</td>\n",
       "      <td>None</td>\n",
       "      <td>[[1725]]</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>161 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  file status  \\\n",
       "0        数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B   \n",
       "1        数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_1.mat      B   \n",
       "2        数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_2.mat      B   \n",
       "3        数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_3.mat      B   \n",
       "4        数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0014\\B014_0.mat      B   \n",
       "..                                                 ...    ...   \n",
       "156  数据集\\数据集\\源域数据集\\48kHz_DE_data\\OR\\Orthogonal\\0021...     OR   \n",
       "157            数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_0.mat      N   \n",
       "158  数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_1_(1772rpm).mat      N   \n",
       "159  数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_2_(1750rpm).mat      N   \n",
       "160            数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat      N   \n",
       "\n",
       "     fault_size_inch    position  load data_id  \\\n",
       "0              0.007        None   0.0    X118   \n",
       "1              0.007        None   1.0    X119   \n",
       "2              0.007        None   2.0    X120   \n",
       "3              0.007        None   3.0    X121   \n",
       "4              0.014        None   0.0    X185   \n",
       "..               ...         ...   ...     ...   \n",
       "156            0.021  Orthogonal   3.0    X253   \n",
       "157            0.000        None   0.0    X097   \n",
       "158            0.000        None   NaN    X098   \n",
       "159            0.000        None   NaN    X099   \n",
       "160            0.000        None   3.0    X100   \n",
       "\n",
       "                                               DE_time  \\\n",
       "0    [0.19612209317762144, 0.16008970204355277, 0.0...   \n",
       "1    [0.16097982148905388, 0.08994307645566291, -0....   \n",
       "2    [-0.10105058205219097, -0.1803892187999539, -0...   \n",
       "3    [-0.1674470103726208, -0.24771332064334256, -0...   \n",
       "4    [0.11470197259011836, -0.04296683269814328, -0...   \n",
       "..                                                 ...   \n",
       "156  [-0.33555718272074553, -0.25088754945955116, 0...   \n",
       "157  [0.04457122843112234, 0.08584069556121486, 0.0...   \n",
       "158  [0.04554089281594434, 0.059045673364322204, -0...   \n",
       "159  [0.09153398120789524, 0.05861900407537136, 0.0...   \n",
       "160  [-0.0004271474948197967, -0.11419057440928315,...   \n",
       "\n",
       "                                               FE_time  \\\n",
       "0    [-0.0709659387026888, 0.0028282335393879712, 0...   \n",
       "1    [0.002356657217093115, 0.009813850877018462, -...   \n",
       "2    [0.09832122634087093, 0.07490081209805338, 0.0...   \n",
       "3    [-0.011039407590665271, 0.03355396270934144, 0...   \n",
       "4    [0.47692705946254066, 0.5432731243039921, 0.42...   \n",
       "..                                                 ...   \n",
       "156  [0.007795672496417106, -0.05681913033861125, 0...   \n",
       "157  [0.1026598048633869, 0.044021890210924744, 0.0...   \n",
       "158  [0.04473781858064439, 0.0050140265735961215, -...   \n",
       "159  [-0.05172357147854265, -0.03727567396030442, 0...   \n",
       "160  [-0.05327251873971267, -0.009675485238823481, ...   \n",
       "\n",
       "                                               BA_time       RPM  \n",
       "0    [-0.01388301295776563, -0.027342452309716176, ...  [[1796]]  \n",
       "1    [-0.024949440281440832, -0.030069670638140623,...  [[1772]]  \n",
       "2    [0.07479378686435133, 0.08153788226372499, 0.0...  [[1748]]  \n",
       "3    [0.00982434925842389, 0.015140455052197322, 0....  [[1722]]  \n",
       "4    [0.024658354915196527, 0.017851081830905568, 0...  [[1796]]  \n",
       "..                                                 ...       ...  \n",
       "156                                               None  [[1719]]  \n",
       "157                                               None  [[1796]]  \n",
       "158                                               None      None  \n",
       "159                                               None      None  \n",
       "160                                               None  [[1725]]  \n",
       "\n",
       "[161 rows x 10 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_wide_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "daee0e7a-84f0-4fcf-b4a7-21bf1c147f9d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "ef7eddff-eb11-45a3-a336-697c5f0adc59",
   "metadata": {},
   "outputs": [],
   "source": [
    "wide_df.to_pickle(\"wide_df.pkl\")\n",
    "# wide_df.to_parquet(\"wide_df.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "b7e56dae-150e-40a3-b924-74af18799a2c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>file</th>\n",
       "      <th>status</th>\n",
       "      <th>fault_size_inch</th>\n",
       "      <th>position</th>\n",
       "      <th>load</th>\n",
       "      <th>data_id</th>\n",
       "      <th>DE_time</th>\n",
       "      <th>FE_time</th>\n",
       "      <th>BA_time</th>\n",
       "      <th>RPM</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>0.196122</td>\n",
       "      <td>-0.070966</td>\n",
       "      <td>-0.013883</td>\n",
       "      <td>1796.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>0.160090</td>\n",
       "      <td>0.002828</td>\n",
       "      <td>-0.027342</td>\n",
       "      <td>1796.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>0.060486</td>\n",
       "      <td>0.098960</td>\n",
       "      <td>-0.047354</td>\n",
       "      <td>1796.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>-0.039384</td>\n",
       "      <td>0.120476</td>\n",
       "      <td>-0.061797</td>\n",
       "      <td>1796.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>-0.077612</td>\n",
       "      <td>0.018543</td>\n",
       "      <td>-0.060898</td>\n",
       "      <td>1796.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            file status  fault_size_inch  \\\n",
       "0  数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B            0.007   \n",
       "1  数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B            0.007   \n",
       "2  数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B            0.007   \n",
       "3  数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B            0.007   \n",
       "4  数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B            0.007   \n",
       "\n",
       "  position  load data_id   DE_time   FE_time   BA_time     RPM  \n",
       "0     None   0.0    X118  0.196122 -0.070966 -0.013883  1796.0  \n",
       "1     None   0.0    X118  0.160090  0.002828 -0.027342  1796.0  \n",
       "2     None   0.0    X118  0.060486  0.098960 -0.047354  1796.0  \n",
       "3     None   0.0    X118 -0.039384  0.120476 -0.061797  1796.0  \n",
       "4     None   0.0    X118 -0.077612  0.018543 -0.060898  1796.0  "
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "def _to_1d(arr):\n",
    "    \"\"\"把 wide_df 的 cell 转为 1D numpy 数组\"\"\"\n",
    "    if arr is None:\n",
    "        return None\n",
    "    a = np.array(arr)\n",
    "    if a.size == 0:\n",
    "        return None\n",
    "    if a.ndim == 1:\n",
    "        return a\n",
    "    if a.ndim == 2 and 1 in a.shape:\n",
    "        return a.reshape(-1)\n",
    "    return a.reshape(-1)\n",
    "\n",
    "def _rpm_from_cell(cell):\n",
    "    \"\"\"提取 RPM 单值\"\"\"\n",
    "    if cell is None:\n",
    "        return None\n",
    "    a = np.array(cell).astype(\"float64\", copy=False)\n",
    "    if a.size == 0:\n",
    "        return None\n",
    "    return float(a.reshape(-1)[0])\n",
    "\n",
    "def expand_wide_df(wide_df):\n",
    "    all_parts = []\n",
    "    for _, row in wide_df.iterrows():\n",
    "        meta = {\n",
    "            \"file\": row[\"file\"],\n",
    "            \"status\": row[\"status\"],\n",
    "            \"fault_size_inch\": row[\"fault_size_inch\"],\n",
    "            \"position\": row[\"position\"],\n",
    "            \"load\": row[\"load\"],\n",
    "            \"data_id\": row[\"data_id\"],\n",
    "        }\n",
    "\n",
    "        # 提取三路信号\n",
    "        de = _to_1d(row[\"DE_time\"])\n",
    "        fe = _to_1d(row[\"FE_time\"])\n",
    "        ba = _to_1d(row[\"BA_time\"])\n",
    "        rpm_val = _rpm_from_cell(row[\"RPM\"])\n",
    "\n",
    "        max_len = max(len(x) if x is not None else 0 for x in [de, fe, ba])\n",
    "        if max_len == 0:\n",
    "            continue\n",
    "\n",
    "        def align(arr):\n",
    "            if arr is None:\n",
    "                return np.full(max_len, np.nan)\n",
    "            if len(arr) < max_len:\n",
    "                return np.concatenate([arr, np.full(max_len - len(arr), np.nan)])\n",
    "            return arr[:max_len]\n",
    "\n",
    "        part = pd.DataFrame({\n",
    "            **meta,\n",
    "            \"DE_time\": align(de),\n",
    "            \"FE_time\": align(fe),\n",
    "            \"BA_time\": align(ba),\n",
    "            \"RPM\": np.full(max_len, rpm_val if rpm_val is not None else np.nan)\n",
    "        })\n",
    "        all_parts.append(part)\n",
    "\n",
    "    long_table = pd.concat(all_parts, ignore_index=True)\n",
    "    return long_table\n",
    "\n",
    "# 使用方法\n",
    "long_table = expand_wide_df(new_wide_df)\n",
    "long_table.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "8b87a03e-eaff-4a6c-befe-79d1627c78f6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>file</th>\n",
       "      <th>status</th>\n",
       "      <th>fault_size_inch</th>\n",
       "      <th>position</th>\n",
       "      <th>load</th>\n",
       "      <th>data_id</th>\n",
       "      <th>DE_time</th>\n",
       "      <th>FE_time</th>\n",
       "      <th>BA_time</th>\n",
       "      <th>RPM</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>0.196122</td>\n",
       "      <td>-0.070966</td>\n",
       "      <td>-0.013883</td>\n",
       "      <td>1796.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>0.160090</td>\n",
       "      <td>0.002828</td>\n",
       "      <td>-0.027342</td>\n",
       "      <td>1796.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>0.060486</td>\n",
       "      <td>0.098960</td>\n",
       "      <td>-0.047354</td>\n",
       "      <td>1796.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>-0.039384</td>\n",
       "      <td>0.120476</td>\n",
       "      <td>-0.061797</td>\n",
       "      <td>1796.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat</td>\n",
       "      <td>B</td>\n",
       "      <td>0.007</td>\n",
       "      <td>None</td>\n",
       "      <td>0.0</td>\n",
       "      <td>X118</td>\n",
       "      <td>-0.077612</td>\n",
       "      <td>0.018543</td>\n",
       "      <td>-0.060898</td>\n",
       "      <td>1796.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41215995</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X100</td>\n",
       "      <td>0.084985</td>\n",
       "      <td>-0.005485</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1725.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41215996</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X100</td>\n",
       "      <td>0.065140</td>\n",
       "      <td>0.028565</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1725.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41215997</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X100</td>\n",
       "      <td>0.048256</td>\n",
       "      <td>0.099158</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1725.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41215998</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X100</td>\n",
       "      <td>0.084984</td>\n",
       "      <td>0.051658</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1725.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41215999</th>\n",
       "      <td>数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat</td>\n",
       "      <td>N</td>\n",
       "      <td>0.000</td>\n",
       "      <td>None</td>\n",
       "      <td>3.0</td>\n",
       "      <td>X100</td>\n",
       "      <td>0.122175</td>\n",
       "      <td>-0.003769</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1725.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>41216000 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                   file status  \\\n",
       "0         数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B   \n",
       "1         数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B   \n",
       "2         数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B   \n",
       "3         数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B   \n",
       "4         数据集\\数据集\\源域数据集\\12kHz_DE_data\\B\\0007\\B007_0.mat      B   \n",
       "...                                                 ...    ...   \n",
       "41215995        数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat      N   \n",
       "41215996        数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat      N   \n",
       "41215997        数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat      N   \n",
       "41215998        数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat      N   \n",
       "41215999        数据集\\数据集\\源域数据集\\48kHz_Normal_data\\N_3.mat      N   \n",
       "\n",
       "          fault_size_inch position  load data_id   DE_time   FE_time  \\\n",
       "0                   0.007     None   0.0    X118  0.196122 -0.070966   \n",
       "1                   0.007     None   0.0    X118  0.160090  0.002828   \n",
       "2                   0.007     None   0.0    X118  0.060486  0.098960   \n",
       "3                   0.007     None   0.0    X118 -0.039384  0.120476   \n",
       "4                   0.007     None   0.0    X118 -0.077612  0.018543   \n",
       "...                   ...      ...   ...     ...       ...       ...   \n",
       "41215995            0.000     None   3.0    X100  0.084985 -0.005485   \n",
       "41215996            0.000     None   3.0    X100  0.065140  0.028565   \n",
       "41215997            0.000     None   3.0    X100  0.048256  0.099158   \n",
       "41215998            0.000     None   3.0    X100  0.084984  0.051658   \n",
       "41215999            0.000     None   3.0    X100  0.122175 -0.003769   \n",
       "\n",
       "           BA_time     RPM  \n",
       "0        -0.013883  1796.0  \n",
       "1        -0.027342  1796.0  \n",
       "2        -0.047354  1796.0  \n",
       "3        -0.061797  1796.0  \n",
       "4        -0.060898  1796.0  \n",
       "...            ...     ...  \n",
       "41215995       NaN  1725.0  \n",
       "41215996       NaN  1725.0  \n",
       "41215997       NaN  1725.0  \n",
       "41215998       NaN  1725.0  \n",
       "41215999       NaN  1725.0  \n",
       "\n",
       "[41216000 rows x 10 columns]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "long_table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "02c33fc7-5ec6-478a-bcc7-ae0af126c56d",
   "metadata": {},
   "outputs": [],
   "source": [
    "long_table.to_csv('源域数据32khz整理.csv',index=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ebc81c13-b3a1-4fd1-aa63-2157f691babf",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
